https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120178

            Bug ID: 120178
           Summary: ICE in fold_build2_loc during profile_estimate when
                    casting free to volatile size_t and adding to malloc
                    pointer in version 13.3
           Product: gcc
           Version: 13.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mario.rodriguezb1 at um dot es
  Target Milestone: ---

The following minimal C code causes an internal compiler error (ICE) during the
profile_estimate GIMPLE pass in GCC 13.3.0:

```
#include <stdlib.h>
int main(void) {
  return!!(malloc(2) + (volatile size_t)free) - 1; }
```

```
during GIMPLE pass: profile_estimate
<source>:3:52: internal compiler error: in build2, at tree.cc:5068
    3 |   return!!(malloc(2) + (volatile size_t)free) - 1; }
      |                                                    ^
0x1cfb19c internal_error(char const*, ...)
        ???:0
0x720063 fancy_abort(char const*, int, char const*)
        ???:0
0xb3ea6f fold_build2_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        ???:0
0xdb8e69 tree_estimate_probability(bool)
        ???:0
```

To reproduce 

https://gcc.godbolt.org/z/b3nWvdMxv

Reply via email to