public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/111856] New: GCC: 14: internal compiler error: in as_a, at machmode.h:381
@ 2023-10-18  3:44 141242068 at smail dot nju.edu.cn
  2023-10-18  6:01 ` [Bug middle-end/111856] ICE with return type of typedef of void and `#pragma omp declare simd` pinskia at gcc dot gnu.org
  2023-10-18  6:05 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: 141242068 at smail dot nju.edu.cn @ 2023-10-18  3:44 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111856
           Summary: GCC: 14: internal compiler error: in as_a, at
                    machmode.h:381
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: 141242068 at smail dot nju.edu.cn
  Target Milestone: ---

When compile this program with option `-fopenmp-simd`, gcc crashes:
```
typedef void T;

int array[1000];
#pragma omp declare simd notinbranch simdlen(4)
T foo (int i)
{
  array[i] = 555;
}
```

Compiler Explorer: https://gcc.godbolt.org/z/Tq665jvzP

Interestingly, by bypassing the `typedef` and directly defining foo's return
type as void, the crash disappears:
```
int array[1000];
#pragma omp declare simd notinbranch simdlen(4)
void foo (int i)
{
  array[i] = 555;
}
```

The stack dump:
```
during IPA pass: simdclone
<source>: In function 'foo.simdclone.0':
<source>:8:1: internal compiler error: in as_a, at machmode.h:381
    8 | }
      | ^
0x230ff8e internal_error(char const*, ...)
        ???:0
0x9fe390 fancy_abort(char const*, int, char const*)
        ???:0
0x1fa0c9f expand_simd_clones(cgraph_node*)
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
```

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug middle-end/111856] ICE with return type of typedef of void and `#pragma omp declare simd`
  2023-10-18  3:44 [Bug c/111856] New: GCC: 14: internal compiler error: in as_a, at machmode.h:381 141242068 at smail dot nju.edu.cn
@ 2023-10-18  6:01 ` pinskia at gcc dot gnu.org
  2023-10-18  6:05 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-18  6:01 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |middle-end
            Summary|GCC: 14: internal compiler  |ICE with return type of
                   |error: in as_a, at          |typedef of void and
                   |machmode.h:381              |`#pragma omp declare simd`

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed,
This is obvious wrong:
  if (orig_rettype == void_type_node)
    return NULL_TREE;


It should be:
  if (TREE_CODE (orig_rettype) == VOID_TYPE)
    return NULL_TREE;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug middle-end/111856] ICE with return type of typedef of void and `#pragma omp declare simd`
  2023-10-18  3:44 [Bug c/111856] New: GCC: 14: internal compiler error: in as_a, at machmode.h:381 141242068 at smail dot nju.edu.cn
  2023-10-18  6:01 ` [Bug middle-end/111856] ICE with return type of typedef of void and `#pragma omp declare simd` pinskia at gcc dot gnu.org
@ 2023-10-18  6:05 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-18  6:05 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-10-18

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
It has been broken since the support was added in r0-126869-g0136f8f03a65 .

If nobody gets around to it and pushes the obvious fix by the weekend I will
test and push the obvious fix.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-18  6:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-18  3:44 [Bug c/111856] New: GCC: 14: internal compiler error: in as_a, at machmode.h:381 141242068 at smail dot nju.edu.cn
2023-10-18  6:01 ` [Bug middle-end/111856] ICE with return type of typedef of void and `#pragma omp declare simd` pinskia at gcc dot gnu.org
2023-10-18  6:05 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).