Bug 95284 - ICE: verify_gimple failed
Summary: ICE: verify_gimple failed
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 11.0
: P3 normal
Target Milestone: ---
Assignee: Richard Biener
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks: yarpgen
  Show dependency treegraph
 
Reported: 2020-05-23 05:29 UTC by Vsevolod Livinskii
Modified: 2021-11-01 23:07 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2020-05-25 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vsevolod Livinskii 2020-05-23 05:29:55 UTC
Reproducer:
#include <algorithm>

short a;
unsigned long long c;
char d;
unsigned e;

void f() {
  for (;;)
    for (char b = 0; b < 19; b += 2)
      a = std::min((1 ? d : 0) ? e : c, (unsigned long long)72252803048);
}

Error:
>$ g++ -O3 func.cpp -c
func.cpp: In function ‘void f()’:
func.cpp:8:6: error: invalid ‘PHI’ argument
    8 | void f() {
      |      ^
{CLOBBER}
_26 = PHI <72252803048(8), {CLOBBER}(5)>
during GIMPLE pass: sink
func.cpp:8:6: internal compiler error: verify_gimple failed
0x113fc71 verify_gimple_in_cfg(function*, bool)
        gcc_src/gcc/tree-cfg.c:5461
0x10132af execute_function_todo
        gcc_src/gcc/passes.c:1985
0x101408e execute_todo
        gcc_src/gcc/passes.c:2039

GCC version:
11.0.0 (bcb63eb2cbd3caf212b9cf42d8c218c09dc6ff8b)
Comment 1 Richard Biener 2020-05-25 07:15:23 UTC
Mine.
Comment 2 GCC Commits 2020-05-25 09:17:31 UTC
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:f73f8bab9f2474f175cc5ca5ba8ebb32808a4cae

commit r11-605-gf73f8bab9f2474f175cc5ca5ba8ebb32808a4cae
Author: Richard Biener <rguenther@suse.de>
Date:   Mon May 25 09:17:51 2020 +0200

    tree-optimization/95284 - amend previous store commoning fix
    
    Generalize check for clobbers.
    
    2020-05-25  Richard Biener  <rguenther@suse.de>
    
            PR tree-optimization/95284
            * tree-ssa-sink.c (sink_common_stores_to_bb): Amend previous
            fix.
    
            * g++.dg/torture/pr95284.C: New testcase.
Comment 3 Richard Biener 2020-05-25 09:18:40 UTC
Fixed.