[Bug tree-optimization/100509] [9/10/11 Regression] ICE at -O3: in fold_convert_loc with variable (attribute) alias of different types

2021-05-25 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100509

--- Comment #6 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Richard Biener
:

https://gcc.gnu.org/g:3870fe246f442d795ef2270c74f56dda9d0be26c

commit r11-8463-g3870fe246f442d795ef2270c74f56dda9d0be26c
Author: Richard Biener 
Date:   Tue May 11 10:58:35 2021 +0200

middle-end/100509 - avoid folding constant to aggregate type

When folding a constant initializer looking through aliases to
incompatible types can lead to us trying to fold a constant
to an aggregate type which can't work.  Simply avoid trying
to constant fold non-register typed symbols.

2021-05-11  Richard Biener  

PR middle-end/100509
* gimple-fold.c (fold_gimple_assign): Only call
get_symbol_constant_value on register type symbols.

* gcc.dg/pr100509.c: New testcase.

(cherry picked from commit ca8e8301180fa71de1a76769fc038df2ab85dfeb)

[Bug tree-optimization/100509] [9/10/11 Regression] ICE at -O3: in fold_convert_loc with variable (attribute) alias of different types

2021-05-11 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100509

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |9.4
Summary|ICE at -O3: in  |[9/10/11 Regression] ICE at
   |fold_convert_loc with   |-O3: in fold_convert_loc
   |variable (attribute) alias  |with variable (attribute)
   |of different types  |alias of different types
  Known to work||12.0
   Priority|P3  |P2

--- Comment #5 from Richard Biener  ---
Fixed on trunk sofar.