Commit ef66212
committed
varasm: Fix up ICE in narrowing_initializer_constant_valid_p [PR105998]
The following testcase ICEs because there is NON_LVALUE_EXPR (location
wrapper) around a VAR_DECL and has TYPE_MODE V2SImode and
SCALAR_INT_TYPE_MODE on that ICEs. Or for -m32 -march=i386 TYPE_MODE
is DImode, but SCALAR_INT_TYPE_MODE still uses the raw V2SImode and ICEs
too.
2022-06-18 Jakub Jelinek <[email protected]>
PR middle-end/105998
* varasm.cc (narrowing_initializer_constant_valid_p): Check
SCALAR_INT_MODE_P instead of INTEGRAL_MODE_P, also break on
! INTEGRAL_TYPE_P and do the same check also on op{0,1}'s type.
* c-c++-common/pr105998.c: New test.1 parent 9991d84 commit ef66212
2 files changed
+20
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4716 | 4716 | | |
4717 | 4717 | | |
4718 | 4718 | | |
4719 | | - | |
| 4719 | + | |
| 4720 | + | |
| 4721 | + | |
| 4722 | + | |
4720 | 4723 | | |
4721 | 4724 | | |
4722 | 4725 | | |
| |||
4728 | 4731 | | |
4729 | 4732 | | |
4730 | 4733 | | |
4731 | | - | |
| 4734 | + | |
| 4735 | + | |
| 4736 | + | |
| 4737 | + | |
4732 | 4738 | | |
4733 | 4739 | | |
4734 | 4740 | | |
| |||
0 commit comments