[Bug tree-optimization/114555] ICE: definition in block 14 does not dominate use in block 15 at -O and above with _BitInt() bitfield

2024-04-04 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114555

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Jakub Jelinek  ---
Fixed.

[Bug tree-optimization/114555] ICE: definition in block 14 does not dominate use in block 15 at -O and above with _BitInt() bitfield

2024-04-04 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114555

--- Comment #3 from GCC Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:48530efdcccb154d3ed200246384edc162debc5d

commit r14-9783-g48530efdcccb154d3ed200246384edc162debc5d
Author: Jakub Jelinek 
Date:   Thu Apr 4 10:47:00 2024 +0200

bitint: Handle m_bitfld_load cast in outer m_cast_conditional [PR114555]

We ICE on the following testcase, because we use result of a PHI node
which is only conditional because of a m_cast_conditional on the outermost
loops PHI node argument and so is invalid SSA form.

The following patch fixes it like similar cases elsewhere by adding
needed intervening PHI(s).

2024-04-04  Jakub Jelinek  

PR tree-optimization/114555
* gimple-lower-bitint.cc (bitint_large_huge::handle_cast): For
m_bitfld_load and save_cast_conditional add any needed PHIs
and adjust t4 accordingly.

* gcc.dg/bitint-103.c: New test.
* gcc.dg/bitint-104.c: New test.

[Bug tree-optimization/114555] ICE: definition in block 14 does not dominate use in block 15 at -O and above with _BitInt() bitfield

2024-04-03 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114555

Jakub Jelinek  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
   Last reconfirmed||2024-04-03
 Status|UNCONFIRMED |ASSIGNED
 Ever confirmed|0   |1

--- Comment #2 from Jakub Jelinek  ---
Created attachment 57862
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57862&action=edit
gcc14-pr114555.patch

So far lightly tested patch.

[Bug tree-optimization/114555] ICE: definition in block 14 does not dominate use in block 15 at -O and above with _BitInt() bitfield

2024-04-03 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114555

--- Comment #1 from Zdenek Sojka  ---
Created attachment 57860
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57860&action=edit
another testcase, failing with -O -fno-tree-forwprop

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fno-tree-forwprop testcase2.c 
testcase2.c: In function 'foo':
testcase2.c:9:1: error: definition in block 14 does not dominate use in block
15
9 | foo(void)
  | ^~~
for SSA_NAME: _17 in statement:
_16 = PHI <_15(2), _17(15)>
PHI argument
_17
for PHI node
_16 = PHI <_15(2), _17(15)>
during GIMPLE pass: bitintlower
testcase2.c:9:1: internal compiler error: verify_ssa failed
0x177b02f verify_ssa(bool, bool)
/repo/gcc-trunk/gcc/tree-ssa.cc:1203
0x13cc2c5 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2095
0x13cc72e execute_todo
/repo/gcc-trunk/gcc/passes.cc:2142
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.