public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/94755] New: [10 Regression] internal compiler error: Segmentation fault
@ 2020-04-25  2:42 anbu1024.me at gmail dot com
  2020-04-25  8:22 ` [Bug c/94755] [9/10 " jakub at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: anbu1024.me at gmail dot com @ 2020-04-25  2:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94755
           Summary: [10 Regression] internal compiler error: Segmentation
                    fault
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat reduced.c 

extern void foo ( void ) ; 

void bar ( double x ) 
{ 
        if ( x == __builtin_speculation_safe_value() ) 
                foo ( ) ; 
} 

--------------------------------------------------------------------------------

$ gcc-10 --version
gcc (GCC) 10.0.1 20200419 (experimental)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

--------------------------------------------------------------------------------

$ gcc-10 reduced.c 
reduced.c: In function ‘bar’:
reduced.c:6:2: error: too few arguments to function
‘__builtin_speculation_safe_value’
    6 |  if ( x == __builtin_speculation_safe_value() )
      |  ^~
reduced.c:6:2: internal compiler error: Segmentation fault
0xdab3ef crash_signal
        ../../gcc-10-20200419/gcc/toplev.c:328
0x89132f vec<tree_node*, va_gc, vl_embed>::operator[](unsigned int)
        ../../gcc-10-20200419/gcc/vec.h:867
0x89132f resolve_overloaded_builtin(unsigned int, tree_node*, vec<tree_node*,
va_gc, vl_embed>*)
        ../../gcc-10-20200419/gcc/c-family/c-common.c:7405
0x81a6c9 c_build_function_call_vec(unsigned int, vec<unsigned int, va_heap,
vl_ptr>, tree_node*, vec<tree_node*, va_gc, vl_embed>*, vec<tree_node*, va_gc,
vl_embed>*)
        ../../gcc-10-20200419/gcc/c/c-typeck.c:3199
0x838cde c_parser_postfix_expression_after_primary
        ../../gcc-10-20200419/gcc/c/c-parser.c:10501
0x8307a1 c_parser_postfix_expression
        ../../gcc-10-20200419/gcc/c/c-parser.c:10176
0x834ada c_parser_unary_expression
        ../../gcc-10-20200419/gcc/c/c-parser.c:8273
0x83632d c_parser_cast_expression
        ../../gcc-10-20200419/gcc/c/c-parser.c:8115
0x83671a c_parser_binary_expression
        ../../gcc-10-20200419/gcc/c/c-parser.c:8041
0x837595 c_parser_conditional_expression
        ../../gcc-10-20200419/gcc/c/c-parser.c:7652
0x837bb0 c_parser_expr_no_commas
        ../../gcc-10-20200419/gcc/c/c-parser.c:7569
0x837e11 c_parser_expression
        ../../gcc-10-20200419/gcc/c/c-parser.c:10637
0x8394a4 c_parser_expression_conv
        ../../gcc-10-20200419/gcc/c/c-parser.c:10670
0x8394a4 c_parser_condition
        ../../gcc-10-20200419/gcc/c/c-parser.c:6329
0x839597 c_parser_paren_condition
        ../../gcc-10-20200419/gcc/c/c-parser.c:6349
0x82e3e0 c_parser_if_statement
        ../../gcc-10-20200419/gcc/c/c-parser.c:6528
0x82e3e0 c_parser_statement_after_labels
        ../../gcc-10-20200419/gcc/c/c-parser.c:6160
0x82ff71 c_parser_compound_statement_nostart
        ../../gcc-10-20200419/gcc/c/c-parser.c:5805
0x84c8c4 c_parser_compound_statement
        ../../gcc-10-20200419/gcc/c/c-parser.c:5617
0x84e381 c_parser_declaration_or_fndef
        ../../gcc-10-20200419/gcc/c/c-parser.c:2505
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

--------------------------------------------------------------------------------

$ gcc-9 --version
gcc (GCC) 9.2.1 20191102
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

--------------------------------------------------------------------------------

$ gcc-9 reduced.c 
reduced.c: In function ‘bar’:
reduced.c:6:2: error: too few arguments to function
‘__builtin_speculation_safe_value’
    6 |  if ( x == __builtin_speculation_safe_value() )
      |  ^~

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

* [Bug c/94755] [9/10 Regression] internal compiler error: Segmentation fault
  2020-04-25  2:42 [Bug c/94755] New: [10 Regression] internal compiler error: Segmentation fault anbu1024.me at gmail dot com
@ 2020-04-25  8:22 ` jakub at gcc dot gnu.org
  2020-04-25  8:22 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-25  8:22 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |9.4
     Ever confirmed|0                           |1
            Summary|[10 Regression] internal    |[9/10 Regression] internal
                   |compiler error:             |compiler error:
                   |Segmentation fault          |Segmentation fault
             Status|UNCONFIRMED                 |NEW
                 CC|                            |jakub at gcc dot gnu.org
   Last reconfirmed|                            |2020-04-25

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

* [Bug c/94755] [9/10 Regression] internal compiler error: Segmentation fault
  2020-04-25  2:42 [Bug c/94755] New: [10 Regression] internal compiler error: Segmentation fault anbu1024.me at gmail dot com
  2020-04-25  8:22 ` [Bug c/94755] [9/10 " jakub at gcc dot gnu.org
@ 2020-04-25  8:22 ` jakub at gcc dot gnu.org
  2020-04-27  6:34 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-25  8:22 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 48371
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48371&action=edit
gcc10-pr94755.patch

Untested fix.

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

* [Bug c/94755] [9/10 Regression] internal compiler error: Segmentation fault
  2020-04-25  2:42 [Bug c/94755] New: [10 Regression] internal compiler error: Segmentation fault anbu1024.me at gmail dot com
  2020-04-25  8:22 ` [Bug c/94755] [9/10 " jakub at gcc dot gnu.org
  2020-04-25  8:22 ` jakub at gcc dot gnu.org
@ 2020-04-27  6:34 ` rguenth at gcc dot gnu.org
  2020-04-27 14:10 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-04-27  6:34 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4

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

* [Bug c/94755] [9/10 Regression] internal compiler error: Segmentation fault
  2020-04-25  2:42 [Bug c/94755] New: [10 Regression] internal compiler error: Segmentation fault anbu1024.me at gmail dot com
                   ` (2 preceding siblings ...)
  2020-04-27  6:34 ` rguenth at gcc dot gnu.org
@ 2020-04-27 14:10 ` cvs-commit at gcc dot gnu.org
  2020-09-16 19:21 ` [Bug c/94755] [9/10/11 " cvs-commit at gcc dot gnu.org
  2021-02-23  9:06 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-27 14:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:26d76be7af6db75aaab662f4e93395f4ff8acb38

commit r10-7989-g26d76be7af6db75aaab662f4e93395f4ff8acb38
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Mon Apr 27 16:05:03 2020 +0200

    c-family: Fix ICE on __builtin_speculation_safe_value () [PR94755]

    When this builtin has no parameters, speculation_safe_value_resolve_call
    returns BUILT_IN_NONE, but resolve_overloaded_builtin uselessly
    dereferences the first param just to return error_mark_node immediately.

    The following patch rearranges it so that we only read the first parameter
    if fncode is not BUILT_IN_NONE.

    2020-04-27  Jakub Jelinek  <jakub@redhat.com>

            PR c/94755
            * c-common.c (resolve_overloaded_builtin): Return error_mark_node
for
            fncode == BUILT_IN_NONE before initialization of first_param.

            * c-c++-common/pr94755.c: New test.

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

* [Bug c/94755] [9/10/11 Regression] internal compiler error: Segmentation fault
  2020-04-25  2:42 [Bug c/94755] New: [10 Regression] internal compiler error: Segmentation fault anbu1024.me at gmail dot com
                   ` (3 preceding siblings ...)
  2020-04-27 14:10 ` cvs-commit at gcc dot gnu.org
@ 2020-09-16 19:21 ` cvs-commit at gcc dot gnu.org
  2021-02-23  9:06 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-09-16 19:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

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

commit r9-8886-gd6a341eb9170fdb21aee235142d1f09e6dc5c5cd
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Mon Apr 27 16:05:03 2020 +0200

    c-family: Fix ICE on __builtin_speculation_safe_value () [PR94755]

    When this builtin has no parameters, speculation_safe_value_resolve_call
    returns BUILT_IN_NONE, but resolve_overloaded_builtin uselessly
    dereferences the first param just to return error_mark_node immediately.

    The following patch rearranges it so that we only read the first parameter
    if fncode is not BUILT_IN_NONE.

    2020-04-27  Jakub Jelinek  <jakub@redhat.com>

            PR c/94755
            * c-common.c (resolve_overloaded_builtin): Return error_mark_node
for
            fncode == BUILT_IN_NONE before initialization of first_param.

            * c-c++-common/pr94755.c: New test.

    (cherry picked from commit 26d76be7af6db75aaab662f4e93395f4ff8acb38)

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

* [Bug c/94755] [9/10/11 Regression] internal compiler error: Segmentation fault
  2020-04-25  2:42 [Bug c/94755] New: [10 Regression] internal compiler error: Segmentation fault anbu1024.me at gmail dot com
                   ` (4 preceding siblings ...)
  2020-09-16 19:21 ` [Bug c/94755] [9/10/11 " cvs-commit at gcc dot gnu.org
@ 2021-02-23  9:06 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-02-23  9:06 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2021-02-23  9:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-25  2:42 [Bug c/94755] New: [10 Regression] internal compiler error: Segmentation fault anbu1024.me at gmail dot com
2020-04-25  8:22 ` [Bug c/94755] [9/10 " jakub at gcc dot gnu.org
2020-04-25  8:22 ` jakub at gcc dot gnu.org
2020-04-27  6:34 ` rguenth at gcc dot gnu.org
2020-04-27 14:10 ` cvs-commit at gcc dot gnu.org
2020-09-16 19:21 ` [Bug c/94755] [9/10/11 " cvs-commit at gcc dot gnu.org
2021-02-23  9:06 ` jakub 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).