public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/104532] New: ICE in lvalue_p, at c/c-typeck.cc:4987
@ 2022-02-14 19:53 gscfq@t-online.de
2022-02-15 17:01 ` [Bug c/104532] " jakub at gcc dot gnu.org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: gscfq@t-online.de @ 2022-02-14 19:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104532
Bug ID: 104532
Summary: ICE in lvalue_p, at c/c-typeck.cc:4987
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: gscfq@t-online.de
Target Milestone: ---
Started between 20211205 and 20211212 :
$ cat z1.c
void f (int x)
{
#pragma omp target enter data map (to: x->vectors)
}
$ cat z2.c
void f (int x)
{
#pragma omp target enter data map (to: x->vectors[])
}
$ gcc-12-20220213 -c z1.c -fopenmp
z1.c: In function 'f':
z1.c:3:11: internal compiler error: Segmentation fault
3 | #pragma omp target enter data map (to: x->vectors)
| ^~~
0xc1c3cf crash_signal
../../gcc/toplev.cc:322
0x6c1a46 lvalue_p(tree_node const*)
../../gcc/c/c-typeck.cc:4987
0x6ca5a8 build_component_ref(unsigned int, tree_node*, tree_node*, unsigned
int)
../../gcc/c/c-typeck.cc:2470
0x6f742e c_parser_omp_variable_list
../../gcc/c/c-parser.cc:13161
0x6f81dc c_parser_omp_clause_map
../../gcc/c/c-parser.cc:16260
0x700262 c_parser_omp_all_clauses
../../gcc/c/c-parser.cc:17057
0x70d6ae c_parser_omp_target_enter_data
../../gcc/c/c-parser.cc:20904
0x70d6ae c_parser_omp_target
../../gcc/c/c-parser.cc:21195
0x6e7a44 c_parser_pragma
../../gcc/c/c-parser.cc:12499
0x7054a6 c_parser_compound_statement_nostart
../../gcc/c/c-parser.cc:5767
0x705873 c_parser_compound_statement
../../gcc/c/c-parser.cc:5609
0x707128 c_parser_declaration_or_fndef
../../gcc/c/c-parser.cc:2544
0x70e85f c_parser_external_declaration
../../gcc/c/c-parser.cc:1779
0x70f18b c_parser_translation_unit
../../gcc/c/c-parser.cc:1652
0x70f18b c_parse_file()
../../gcc/c/c-parser.cc:23348
0x760792 c_common_parse_file()
../../gcc/c-family/c-opts.cc:1238
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c/104532] ICE in lvalue_p, at c/c-typeck.cc:4987
2022-02-14 19:53 [Bug c/104532] New: ICE in lvalue_p, at c/c-typeck.cc:4987 gscfq@t-online.de
@ 2022-02-15 17:01 ` jakub at gcc dot gnu.org
2022-02-16 13:34 ` jakub at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-02-15 17:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104532
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Last reconfirmed| |2022-02-15
CC| |cltang at gcc dot gnu.org,
| |jakub at gcc dot gnu.org
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r12-5835-g0ab29cf0bb68960c1f87405f14b4fb2109254e2f
I guess the
if (c_parser_next_token_is (parser, CPP_DEREF))
t = build_simple_mem_ref (t);
is wrong, CPP_DEREF handling elsewhere calls
expr = convert_lvalue_to_rvalue (expr_loc, expr, true, false);
and uses
expr.value = build_component_ref (op_loc,
build_indirect_ref (op_loc,
expr.value,
RO_ARROW),
ident, comp_loc);
So I think we should do that convert_lvalue_to_rvalue and build_indirect_ref
instead of build_simple_mem_ref.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c/104532] ICE in lvalue_p, at c/c-typeck.cc:4987
2022-02-14 19:53 [Bug c/104532] New: ICE in lvalue_p, at c/c-typeck.cc:4987 gscfq@t-online.de
2022-02-15 17:01 ` [Bug c/104532] " jakub at gcc dot gnu.org
@ 2022-02-16 13:34 ` jakub at gcc dot gnu.org
2022-02-17 9:31 ` cvs-commit at gcc dot gnu.org
2022-02-17 9:35 ` jakub at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-02-16 13:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104532
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 52454
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52454&action=edit
gcc12-pr104532.patch
Untested patch I wrote in the meantime (passes make check-gcc for
gomp.exp/goacc.exp/goacc-gomp.exp so far).
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c/104532] ICE in lvalue_p, at c/c-typeck.cc:4987
2022-02-14 19:53 [Bug c/104532] New: ICE in lvalue_p, at c/c-typeck.cc:4987 gscfq@t-online.de
2022-02-15 17:01 ` [Bug c/104532] " jakub at gcc dot gnu.org
2022-02-16 13:34 ` jakub at gcc dot gnu.org
@ 2022-02-17 9:31 ` cvs-commit at gcc dot gnu.org
2022-02-17 9:35 ` jakub at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-17 9:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104532
--- Comment #3 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:f99ad11af953568e1a01e4f4fe31cba0f11879a5
commit r12-7274-gf99ad11af953568e1a01e4f4fe31cba0f11879a5
Author: Jakub Jelinek <jakub@redhat.com>
Date: Thu Feb 17 10:29:06 2022 +0100
openmp: Ensure proper diagnostics for -> in map/to/from clauses [PR104532]
The following patch uses the functions normal CPP_DEREF parsing uses,
i.e. convert_lvalue_to_rvalue and build_indirect_ref, instead of
blindly calling build_simple_mem_ref, so that if the variable does not
have correct type, we properly diagnose it instead of ICEing on it.
2022-02-17 Jakub Jelinek <jakub@redhat.com>
PR c/104532
* c-parser.cc (c_parser_omp_variable_list): For CPP_DEREF, use
convert_lvalue_to_rvalue and build_indirect_ref instead of
build_simple_mem_ref.
* gcc.dg/gomp/pr104532.c: New test.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c/104532] ICE in lvalue_p, at c/c-typeck.cc:4987
2022-02-14 19:53 [Bug c/104532] New: ICE in lvalue_p, at c/c-typeck.cc:4987 gscfq@t-online.de
` (2 preceding siblings ...)
2022-02-17 9:31 ` cvs-commit at gcc dot gnu.org
@ 2022-02-17 9:35 ` jakub at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-02-17 9:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104532
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-02-17 9:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-14 19:53 [Bug c/104532] New: ICE in lvalue_p, at c/c-typeck.cc:4987 gscfq@t-online.de
2022-02-15 17:01 ` [Bug c/104532] " jakub at gcc dot gnu.org
2022-02-16 13:34 ` jakub at gcc dot gnu.org
2022-02-17 9:31 ` cvs-commit at gcc dot gnu.org
2022-02-17 9:35 ` 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).