WARNING: This server is unstable and will be retired in the next days.
If you want to keep this forum available, please request immediately a migration
on the Nabble Support forum.
Forums that don't receive any migration request will be deleted forever.
> Georg-Johann Lay wrote:
>> Georg-Johann Lay wrote:
>>> Richard Guenther wrote:
>>>> Georg-Johann Lay wrote:
>>>>> http://gcc.gnu.org/PR51527 >>>>>
>>>>> It works with 4.8 trunk but crashes with 4.7.
>>>>> Did not yet track what changes made it work with 4.8, though.
>>>>> Unfortunately, noone remembers :-(
>>>>> http://gcc.gnu.org/ml/gcc/2012-03/msg00440.html >>>> I have done changes in this area, trying to remove the type_for_size langhook.
>>> One apparent change is tree.c:signed_or_unsigned_type_for
>>> that changed [...] at 2012-03-12
>>> http://gcc.gnu.org/viewcvs?view=revision&revision=185226 >>>
>>> Is this appropriate to backport?
> No, it's not.
>>> Or is the preferred solution to override lang_hooks.types.type_for_size in the
>>> backend, if applicable?
> Neither. It is a "lang"-hook, not a target-hook after all.
> I already told you what the right fix is - the callers of
> type_for_size have to cater
> for the returned type to be of different precision. Btw, I already see it does
> /* But now perhaps TYPEX is as wide as INPREC.
> In that case, do nothing special here.
> (Otherwise would recurse infinitely in convert. */
> if (TYPE_PRECISION (typex) != inprec)
Would you help me with the code? It's almost impossible to understand the
convert stuff for a noob. I tried TARGET_CONVERT_TO_TYPE
avr_convert_to_type (tree type, tree expr)
tree xtype = TREE_TYPE (expr);
/* convert enters infinite recursion for __int24 -> unsigned long
if (/* From __int24 ... */
TREE_CODE (xtype) == INTEGER_TYPE
&& TYPE_PRECISION (xtype) == 24
&& !TYPE_UNSIGNED (xtype)
/* ... to unsigned long. */
&& TREE_CODE (type) == INTEGER_TYPE
&& TYPE_PRECISION (type) > 24
&& TYPE_UNSIGNED (type))
/* Perform an intermediate conversion:
__int24 -> long -> unsigned long */
/* Signed variant of type */
tree stype = lang_hooks.types.type_for_mode (TYPE_MODE (type), 0);