public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/113267] New: pragma novector ICEs when no loop condition
@ 2024-01-08 10:32 tnfchris at gcc dot gnu.org
  2024-01-08 10:33 ` [Bug c/113267] " tnfchris at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2024-01-08 10:32 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113267
           Summary: pragma novector ICEs when no loop condition
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tnfchris at gcc dot gnu.org
  Target Milestone: ---

The following:

void f (char *a, int i)
{
#pragma GCC novector
  for (;;i++)
    a[i] *= 2;
}

segfaults:

pragma.c: In function 'f':
pragma.c:4:3: internal compiler error: Segmentation fault
    4 |   for (;;i++)
      |   ^~~
0x17d238f crash_signal
        /data/tamchr01/gnu-work-b1/src/gcc/gcc/toplev.cc:316
0x7fb59e26451f ???
        ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0xd9b626 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
        /data/tamchr01/gnu-work-b1/src/gcc/gcc/tree.h:3757
0xe4600a c_parser_for_statement
        /data/tamchr01/gnu-work-b1/src/gcc/gcc/c/c-parser.cc:8446
0xe59e57 c_parser_pragma
        /data/tamchr01/gnu-work-b1/src/gcc/gcc/c/c-parser.cc:14676
0xe42daa c_parser_compound_statement_nostart
        /data/tamchr01/gnu-work-b1/src/gcc/gcc/c/c-parser.cc:7201
0xe40b00 c_parser_compound_statement
        /data/tamchr01/gnu-work-b1/src/gcc/gcc/c/c-parser.cc:6527
0xe37915 c_parser_declaration_or_fndef

because there's no loop condition to attach the pragma too.

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

* [Bug c/113267] pragma novector ICEs when no loop condition
  2024-01-08 10:32 [Bug c/113267] New: pragma novector ICEs when no loop condition tnfchris at gcc dot gnu.org
@ 2024-01-08 10:33 ` tnfchris at gcc dot gnu.org
  2024-01-08 10:53 ` tnfchris at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2024-01-08 10:33 UTC (permalink / raw)
  To: gcc-bugs

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

Tamar Christina <tnfchris at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2024-01-08
           Assignee|unassigned at gcc dot gnu.org      |tnfchris at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
mine.

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

* [Bug c/113267] pragma novector ICEs when no loop condition
  2024-01-08 10:32 [Bug c/113267] New: pragma novector ICEs when no loop condition tnfchris at gcc dot gnu.org
  2024-01-08 10:33 ` [Bug c/113267] " tnfchris at gcc dot gnu.org
@ 2024-01-08 10:53 ` tnfchris at gcc dot gnu.org
  2024-01-09 11:19 ` cvs-commit at gcc dot gnu.org
  2024-01-09 11:25 ` tnfchris at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2024-01-08 10:53 UTC (permalink / raw)
  To: gcc-bugs

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

Tamar Christina <tnfchris at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0

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

* [Bug c/113267] pragma novector ICEs when no loop condition
  2024-01-08 10:32 [Bug c/113267] New: pragma novector ICEs when no loop condition tnfchris at gcc dot gnu.org
  2024-01-08 10:33 ` [Bug c/113267] " tnfchris at gcc dot gnu.org
  2024-01-08 10:53 ` tnfchris at gcc dot gnu.org
@ 2024-01-09 11:19 ` cvs-commit at gcc dot gnu.org
  2024-01-09 11:25 ` tnfchris at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-09 11:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tamar Christina <tnfchris@gcc.gnu.org>:

https://gcc.gnu.org/g:109f2316725bd74d85279fa749e5ea59686ad320

commit r14-7037-g109f2316725bd74d85279fa749e5ea59686ad320
Author: Tamar Christina <tamar.christina@arm.com>
Date:   Tue Jan 9 11:19:24 2024 +0000

    frontend: don't ice with pragma NOVECTOR if loop has no condition
[PR113267]

    In C you can have loops without a condition, the original version of the
patch
    was rejecting the use of #pragma GCC novector, however during review it was
    changed to not due this with the reason that we didn't want to give a
compile
    error with such cases.

    However because annotations seem to be only be allowed on conditions
(unless
    I'm mistaken?) the attached example ICEs because there's no condition.

    This will have it ignore the pragma instead of ICEing.  I don't know if
this is
    the best solution,  but as far as I can tell we can't attach the annotation
to
    anything else.

    gcc/c/ChangeLog:

            PR c/113267
            * c-parser.cc (c_parser_for_statement): Skip the pragma is no cond.

    gcc/testsuite/ChangeLog:

            PR c/113267
            * gcc.dg/pr113267.c: New test.

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

* [Bug c/113267] pragma novector ICEs when no loop condition
  2024-01-08 10:32 [Bug c/113267] New: pragma novector ICEs when no loop condition tnfchris at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-01-09 11:19 ` cvs-commit at gcc dot gnu.org
@ 2024-01-09 11:25 ` tnfchris at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2024-01-09 11:25 UTC (permalink / raw)
  To: gcc-bugs

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

Tamar Christina <tnfchris at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2024-01-09 11:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-08 10:32 [Bug c/113267] New: pragma novector ICEs when no loop condition tnfchris at gcc dot gnu.org
2024-01-08 10:33 ` [Bug c/113267] " tnfchris at gcc dot gnu.org
2024-01-08 10:53 ` tnfchris at gcc dot gnu.org
2024-01-09 11:19 ` cvs-commit at gcc dot gnu.org
2024-01-09 11:25 ` tnfchris 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).