[Bug tree-optimization/121103] [15/16 Regression] ICE at O2: in single_succ_edge, at basic-block.h:332

2025-07-16 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121103

--- Comment #5 from Richard Biener  ---
(In reply to Andrew Pinski from comment #2)
> Confirmed.
> 
> When `memmove(p->d, a.s, a.n);` is folded into:
> 
> ;;   basic block 3, loop depth 0
> ;;pred:   2
>   _7 = MEM  [(char * {ref-all})&c];
>   MEM  [(char * {ref-all})&b] = _7;
> ;;succ:  
> 
> The noreturn function call is gone. I am not sure what is the correct fix.

Not folding a noreturn call to an inline sequence.  Or do what the inliner
does, and put in a gcc_unreachable ().  I'd prefer the former.

[Bug tree-optimization/121103] [15/16 Regression] ICE at O2: in single_succ_edge, at basic-block.h:332

2025-07-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121103

--- Comment #4 from Andrew Pinski  ---
(In reply to Richard Biener from comment #1)
> But we are also not catching this in the verify flow
> info verifier.

That is PR 119605 but I have not had time to implement it yet.

[Bug tree-optimization/121103] [15/16 Regression] ICE at O2: in single_succ_edge, at basic-block.h:332

2025-07-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121103

--- Comment #3 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #2)
> Confirmed.
> 
> When `memmove(p->d, a.s, a.n);` is folded into:
> 
> ;;   basic block 3, loop depth 0
> ;;pred:   2
>   _7 = MEM  [(char * {ref-all})&c];
>   MEM  [(char * {ref-all})&b] = _7;
> ;;succ:  
> 
> The noreturn function call is gone. I am not sure what is the correct fix.

Not doing s/a.n/8/ also causes the problem but in forwprop1 rather than fre.

[Bug tree-optimization/121103] [15/16 Regression] ICE at O2: in single_succ_edge, at basic-block.h:332

2025-07-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121103

--- Comment #2 from Andrew Pinski  ---
Confirmed.

When `memmove(p->d, a.s, a.n);` is folded into:

;;   basic block 3, loop depth 0
;;pred:   2
  _7 = MEM  [(char * {ref-all})&c];
  MEM  [(char * {ref-all})&b] = _7;
;;succ:  

The noreturn function call is gone. I am not sure what is the correct fix.

[Bug tree-optimization/121103] [15/16 Regression] ICE at O2: in single_succ_edge, at basic-block.h:332

2025-07-16 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121103

Richard Biener  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2025-07-16

--- Comment #1 from Richard Biener  ---
There's an invalid CFG with BB with missing outgoing edge.  The issue is the

extern void *memmove(void *, const void *, __SIZE_TYPE__)
__attribute__((noreturn));

and simplification of

;;   basic block 6, loop depth 0
;;pred:   5
  _11 = (long unsigned int) a$n_9;
  _12 = a$s_23;
  memmove (&b.d, _12, _11);
;;succ:

by folding during FRE.  But we are also not catching this in the verify flow
info verifier.

[Bug tree-optimization/121103] [15/16 Regression] ICE at O2: in single_succ_edge, at basic-block.h:332

2025-07-15 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121103

Andrew Pinski  changed:

   What|Removed |Added

 CC||pinskia at gcc dot gnu.org
Summary|ICE at O2: in   |[15/16 Regression] ICE at
   |single_succ_edge, at|O2: in single_succ_edge, at
   |basic-block.h:332   |basic-block.h:332
   Target Milestone|--- |15.2