public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "zsojka at seznam dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/104472] New: ICE: SIGSEGV in cxx_eval_internal_function with __builtin_convertvector()
Date: Wed, 09 Feb 2022 18:34:00 +0000	[thread overview]
Message-ID: <bug-104472-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 104472
           Summary: ICE: SIGSEGV in cxx_eval_internal_function with
                    __builtin_convertvector()
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

Created attachment 52397
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52397&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-g++ -frounding-math testcase.C -wrapper valgrind,-q
==29185== Invalid read of size 2
==29185==    at 0xE39E1F: cxx_eval_internal_function(constexpr_ctx const*,
tree_node*, bool, bool*, bool*) (constexpr.cc:1842)
==29185==    by 0xE2D5D6: cxx_eval_call_expression(constexpr_ctx const*,
tree_node*, bool, bool*, bool*) (constexpr.cc:2395)
==29185==    by 0xE3090C: cxx_eval_constant_expression(constexpr_ctx const*,
tree_node*, bool, bool*, bool*, tree_node**) (constexpr.cc:6637)
==29185==    by 0xE3D247: cxx_eval_binary_expression(constexpr_ctx const*,
tree_node*, bool, bool*, bool*) (constexpr.cc:3337)
==29185==    by 0xE302FB: cxx_eval_constant_expression(constexpr_ctx const*,
tree_node*, bool, bool*, bool*, tree_node**) (constexpr.cc:7014)
==29185==    by 0xE34956: cxx_eval_outermost_constant_expr(tree_node*, bool,
bool, bool, bool, tree_node*) (constexpr.cc:7709)
==29185==    by 0xE3739D: potential_constant_expression_1(tree_node*, bool,
bool, bool, int, tree_node**) (constexpr.cc:9285)
==29185==    by 0xE38148: potential_constant_expression_1 (constexpr.cc:9438)
==29185==    by 0xE38148: is_rvalue_constant_expression(tree_node*)
(constexpr.cc:9503)
==29185==    by 0xF635FC: cp_parser_constant_expression(cp_parser*, int, bool*,
bool) (parser.cc:10663)
==29185==    by 0xF636D1: cp_parser_initializer_clause(cp_parser*, bool*)
(parser.cc:25216)
==29185==    by 0xF66E5C: cp_parser_initializer(cp_parser*, bool*, bool*, bool)
(parser.cc:25156)
==29185==    by 0xF967B3: cp_parser_init_declarator(cp_parser*, int,
cp_decl_specifier_seq*, vec<deferred_access_check, va_gc, vl_embed>*, bool,
bool, int, bool*, tree_node**, unsigned int*, tree_node**) (parser.cc:22766)
==29185==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==29185== 
testcase.C:4:77: internal compiler error: Segmentation fault
    4 | V v = __builtin_convertvector (__builtin_convertvector ((V){5534}, F),
V) < 8;
      |                                                                        
    ^
0x167637f crash_signal
        /repo/gcc-trunk/gcc/toplev.cc:322
0xe39e1f cxx_eval_internal_function
        /repo/gcc-trunk/gcc/cp/constexpr.cc:1842
0xe2d5d6 cxx_eval_call_expression
        /repo/gcc-trunk/gcc/cp/constexpr.cc:2395
0xe3090c cxx_eval_constant_expression
        /repo/gcc-trunk/gcc/cp/constexpr.cc:6637
0xe3d247 cxx_eval_binary_expression
        /repo/gcc-trunk/gcc/cp/constexpr.cc:3337
0xe302fb cxx_eval_constant_expression
        /repo/gcc-trunk/gcc/cp/constexpr.cc:7014
0xe34956 cxx_eval_outermost_constant_expr
        /repo/gcc-trunk/gcc/cp/constexpr.cc:7709
0xe3739d potential_constant_expression_1
        /repo/gcc-trunk/gcc/cp/constexpr.cc:9285
0xe38148 potential_constant_expression_1(tree_node*, bool, bool, bool, int)
        /repo/gcc-trunk/gcc/cp/constexpr.cc:9438
0xe38148 is_rvalue_constant_expression(tree_node*)
        /repo/gcc-trunk/gcc/cp/constexpr.cc:9503
0xf635fc cp_parser_constant_expression
        /repo/gcc-trunk/gcc/cp/parser.cc:10663
0xf636d1 cp_parser_initializer_clause
        /repo/gcc-trunk/gcc/cp/parser.cc:25216
0xf66e5c cp_parser_initializer
        /repo/gcc-trunk/gcc/cp/parser.cc:25156
0xf967b3 cp_parser_init_declarator
        /repo/gcc-trunk/gcc/cp/parser.cc:22766
0xf710b3 cp_parser_simple_declaration
        /repo/gcc-trunk/gcc/cp/parser.cc:15286
0xfa16a5 cp_parser_declaration
        /repo/gcc-trunk/gcc/cp/parser.cc:14972
0xfa211a cp_parser_toplevel_declaration
        /repo/gcc-trunk/gcc/cp/parser.cc:14993
0xfa211a cp_parser_translation_unit
        /repo/gcc-trunk/gcc/cp/parser.cc:5012
0xfa211a c_parse_file()
        /repo/gcc-trunk/gcc/cp/parser.cc:48042
0x10d8b0d c_common_parse_file()
        /repo/gcc-trunk/gcc/c-family/c-opts.cc:1238
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.

$ x86_64-pc-linux-gnu-g++ -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-g++
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r12-7128-20220209090954-gc6bb1db76b3-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-7128-20220209090954-gc6bb1db76b3-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.1 20220209 (experimental) (GCC)

             reply	other threads:[~2022-02-09 18:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-09 18:34 zsojka at seznam dot cz [this message]
2022-02-10 11:51 ` [Bug c++/104472] ICE: SIGSEGV in cxx_eval_internal_function with __builtin_convertvector and -frounding-math jakub at gcc dot gnu.org
2022-02-11 12:53 ` cvs-commit at gcc dot gnu.org
2022-02-11 12:54 ` jakub at gcc dot gnu.org
2022-02-19  8:02 ` cvs-commit at gcc dot gnu.org
2022-05-10  8:23 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:24 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:36 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-104472-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).