public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/107557] [12/13/14 Regression] ICE -fsanitize=undefined and VLA as argument type to a function Date: Tue, 23 May 2023 20:05:18 +0000 [thread overview] Message-ID: <bug-107557-4-8rKaGTTGnp@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-107557-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107557 --- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Martin Uecker <uecker@gcc.gnu.org>: https://gcc.gnu.org/g:f9b5be322358ee63798e02a9103b6bbe459e7aea commit r14-1142-gf9b5be322358ee63798e02a9103b6bbe459e7aea Author: Martin Uecker <uecker@tugraz.at> Date: Thu Apr 13 19:37:12 2023 +0200 Fix ICEs related to VM types in C 1/2 [PR70418, PR107557, PR108423] Size expressions were sometimes lost and not gimplified correctly, leading to ICEs and incorrect evaluation order. Fix this by 1) not recursing into pointers when gimplifying parameters in the middle-end (the code is merged with gimplify_type_sizes), which is incorrect because it might access variables declared later for incomplete structs, and 2) tracking size expressions for struct/union members correctly, 3) emitting code to evaluate size expressions for missing cases (nested functions, empty declarations, and structs/unions). PR c/70418 PR c/106465 PR c/107557 PR c/108423 gcc/c/ * c-decl.cc (start_decl): Make sure size expression are evaluated only in correct context. (grokdeclarator): Size expression in fields may need a bind expression, make sure DECL_EXPR is always created. (grokfield, declspecs_add_type): Pass along size expressions. (finish_struct): Remove unneeded DECL_EXPR. (start_function): Evaluate size expressions for nested functions. * c-parser.cc (c_parser_struct_declarations, c_parser_struct_or_union_specifier): Pass along size expressions. (c_parser_declaration_or_fndef): Evaluate size expression. (c_parser_objc_at_property_declaration, c_parser_objc_class_instance_variables): Adapt. * c-tree.h (grokfield): Adapt declaration. gcc/testsuite/ * gcc.dg/nested-vla-1.c: New test. * gcc.dg/nested-vla-2.c: New test. * gcc.dg/nested-vla-3.c: New test. * gcc.dg/pr70418.c: New test. * gcc.dg/pr106465.c: New test. * gcc.dg/pr107557-1.c: New test. * gcc.dg/pr107557-2.c: New test. * gcc.dg/pr108423-1.c: New test. * gcc.dg/pr108423-2.c: New test. * gcc.dg/pr108423-3.c: New test. * gcc.dg/pr108423-4.c: New test. * gcc.dg/pr108423-5.c: New test. * gcc.dg/pr108423-6.c: New test. * gcc.dg/typename-vla-2.c: New test. * gcc.dg/typename-vla-3.c: New test. * gcc.dg/typename-vla-4.c: New test. * gcc.misc-tests/gcov-pr85350.c: Adapt.
next prev parent reply other threads:[~2023-05-23 20:05 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-11-07 18:12 [Bug c/107557] New: [12/13 Regression] ICE in make_ssa_name_fn, at tree-ssanames.cc:360 gscfq@t-online.de 2022-11-07 18:12 ` [Bug c/107557] " gscfq@t-online.de 2022-11-07 20:10 ` pinskia at gcc dot gnu.org 2022-11-08 9:29 ` [Bug c/107557] [12/13 Regression] ICE -fsanitize=undefined and VLA as argument type to a function rguenth at gcc dot gnu.org 2022-11-21 12:33 ` marxin at gcc dot gnu.org 2023-01-13 12:40 ` rguenth at gcc dot gnu.org 2023-01-21 19:23 ` muecker at gwdg dot de 2023-02-11 15:07 ` muecker at gwdg dot de 2023-02-24 14:40 ` muecker at gwdg dot de 2023-04-09 11:54 ` muecker at gwdg dot de 2023-05-08 12:25 ` [Bug c/107557] [12/13/14 " rguenth at gcc dot gnu.org 2023-05-18 12:57 ` muecker at gwdg dot de 2023-05-23 20:05 ` cvs-commit at gcc dot gnu.org [this message] 2023-11-15 7:17 ` sjames at gcc dot gnu.org 2023-11-15 7:45 ` uecker 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-107557-4-8rKaGTTGnp@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: linkBe 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).