[Bug middle-end/100786] [9/10/11/12 Regression] ICE: in fold_convert_loc with alias attribute and different types and different sizes

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Dec 10 02:52:24 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100786

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-12-10
   Target Milestone|---                         |9.5
      Known to fail|                            |11.1.0, 4.9.0, 5.1.0
      Known to work|                            |4.7.1, 4.8.5
     Ever confirmed|0                           |1
            Summary|ICE: in fold_convert_loc    |[9/10/11/12 Regression]
                   |with alias attribute and    |ICE: in fold_convert_loc
                   |different types and         |with alias attribute and
                   |different sizes             |different types and
                   |                            |different sizes

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Can also reproduce using the following code with the C++ front-end:
extern const double a = 0;
extern int b __attribute__((alias("a")));
int inc() { b++; }

Confirmed.  I think the alias should be rejected if the following is true:
(TREE_CODE (a) == FUNCTION_DECL) != (TREE_CODE (b) == FUNCTION_DECL)
|| (sizeof (a) != sizeof (b))


More information about the Gcc-bugs mailing list