public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/67580] New: Improve error message on missing "struct" tag
@ 2015-09-14 22:41 chengniansun at gmail dot com
  2015-09-15  0:17 ` [Bug c/67580] " manu at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: chengniansun at gmail dot com @ 2015-09-14 22:41 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67580
           Summary: Improve error message on missing "struct" tag
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chengniansun at gmail dot com
  Target Milestone: ---

I wonder whether the error message on missing the 'struct' tag can be improved.
IMHO, clang gives a clearer message on how to fix the error. This also applies
to union types.  

$: cat t.c
struct S {int s;};

void f(int a) {
  S s = {a};
}
$: gcc-trunk -c t.c
t.c: In function ‘f’:
t.c:4:3: error: unknown type name ‘S’
   S s = {a};
   ^
$: clang-trunk -c t.c
t.c:4:3: error: must use 'struct' tag to refer to type 'S'
  S s = {a};
  ^
  struct 
1 error generated.
$:
>From gcc-bugs-return-497215-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Sep 15 00:11:25 2015
Return-Path: <gcc-bugs-return-497215-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 100403 invoked by alias); 15 Sep 2015 00:11:25 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 100320 invoked by uid 48); 15 Sep 2015 00:11:16 -0000
From: "su at cs dot ucdavis.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/67581] New: ICE on transparent union with -g enabled on x86_64-linux-gnu (verify_type failed)
Date: Tue, 15 Sep 2015 00:11:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: su at cs dot ucdavis.edu
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-67581-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-09/txt/msg01193.txt.bz2
Content-length: 6337

https://gcc.gnu.org/bugzilla/show_bug.cgi?idg581

            Bug ID: 67581
           Summary: ICE on transparent union with -g enabled on
                    x86_64-linux-gnu (verify_type failed)
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

The following code causes an ICE when compiled with the current gcc trunk on
x86_64-linux-gnu when -g is enabled.

This is a regression from 5.2.x.


$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20150914 (experimental) [trunk revision 227747] (GCC)
$
$ g++-trunk -c t.cc
$ g++-5.2 -c -g t.cc
$
$ g++-trunk -c -g t.cc
t.cc:1:7: error: type variant differs by TYPE_TRANSPARENT_AGGR.
 union U
       ^
 <union_type 0x7fefaab41348 U asm_written transparent-aggr type_5 SI
    size <integer_cst 0x7fefaa9fd0a8 type <integer_type 0x7fefaa9df2a0
bitsizetype> constant 32>
    unit size <integer_cst 0x7fefaa9fd0c0 type <integer_type 0x7fefaa9df1f8
sizetype> constant 4>
    align 32 symtab -1432334256 alias set -1 canonical type 0x7fefaab41348
    fields <field_decl 0x7fefaab3e4c0 x
        type <integer_type 0x7fefaa9df7e0 int asm_written public SI size
<integer_cst 0x7fefaa9fd0a8 32> unit size <integer_cst 0x7fefaa9fd0c0 4>
            align 32 symtab -1432334096 alias set -1 canonical type
0x7fefaa9df7e0 precision 32 min <integer_cst 0x7fefaa9fd060 -2147483648> max
<integer_cst 0x7fefaa9fd078 2147483647>
            pointer_to_this <pointer_type 0x7fefaaa01930>>
        nonlocal decl_3 SI file t.cc line 3 col 7 size <integer_cst
0x7fefaa9fd0a8 32> unit size <integer_cst 0x7fefaa9fd0c0 4>
        align 32 offset_align 128
        offset <integer_cst 0x7fefaa9dbe88 constant 0>
        bit offset <integer_cst 0x7fefaa9dbed0 constant 0> context <union_type
0x7fefaab41348 U>
        chain <field_decl 0x7fefaab3e558 y type <real_type 0x7fefaaa01540
float>
            nonlocal decl_3 SF file t.cc line 4 col 9 size <integer_cst
0x7fefaa9fd0a8 32> unit size <integer_cst 0x7fefaa9fd0c0 4>
            align 32 offset_align 128 offset <integer_cst 0x7fefaa9dbe88 0> bit
offset <integer_cst 0x7fefaa9dbed0 0> context <union_type 0x7fefaab41348 U>
chain <type_decl 0x7fefaab3e428 U>>> context <translation_unit_decl
0x7fefabdb01e0 D.1>
    full-name "union U"
    X() X(constX&) this=(X&)
    chain <type_decl 0x7fefaab3e390 U>>
 <union_type 0x7fefaab413f0 U type_5 SI
    size <integer_cst 0x7fefaa9fd0a8 type <integer_type 0x7fefaa9df2a0
bitsizetype> constant 32>
    unit size <integer_cst 0x7fefaa9fd0c0 type <integer_type 0x7fefaa9df1f8
sizetype> constant 4>
    align 32 symtab 0 alias set -1 canonical type 0x7fefaab41348
    fields <field_decl 0x7fefaab3e4c0 x
        type <integer_type 0x7fefaa9df7e0 int asm_written public SI size
<integer_cst 0x7fefaa9fd0a8 32> unit size <integer_cst 0x7fefaa9fd0c0 4>
            align 32 symtab -1432334096 alias set -1 canonical type
0x7fefaa9df7e0 precision 32 min <integer_cst 0x7fefaa9fd060 -2147483648> max
<integer_cst 0x7fefaa9fd078 2147483647>
            pointer_to_this <pointer_type 0x7fefaaa01930>>
        nonlocal decl_3 SI file t.cc line 3 col 7 size <integer_cst
0x7fefaa9fd0a8 32> unit size <integer_cst 0x7fefaa9fd0c0 4>
        align 32 offset_align 128
        offset <integer_cst 0x7fefaa9dbe88 constant 0>
        bit offset <integer_cst 0x7fefaa9dbed0 constant 0> context <union_type
0x7fefaab41348 U>
        chain <field_decl 0x7fefaab3e558 y type <real_type 0x7fefaaa01540
float>
            nonlocal decl_3 SF file t.cc line 4 col 9 size <integer_cst
0x7fefaa9fd0a8 32> unit size <integer_cst 0x7fefaa9fd0c0 4>
            align 32 offset_align 128 offset <integer_cst 0x7fefaa9dbe88 0> bit
offset <integer_cst 0x7fefaa9dbed0 0> context <union_type 0x7fefaab41348 U>
chain <type_decl 0x7fefaab3e428 U>>> context <translation_unit_decl
0x7fefabdb01e0 D.1>
    full-name "union U"
    X() X(constX&) this=(X&)
    chain <type_decl 0x7fefaab3e390 U>>
t.cc:1:7: internal compiler error: verify_type failed
0xf1ebf9 verify_type(tree_node const*)
        ../../gcc-trunk/gcc/tree.c:13583
0x97fb04 gen_type_die_with_usage
        ../../gcc-trunk/gcc/dwarf2out.c:20707
0x981186 gen_type_die
        ../../gcc-trunk/gcc/dwarf2out.c:20901
0x98d7c1 gen_decl_die
        ../../gcc-trunk/gcc/dwarf2out.c:21487
0x97ef9d gen_member_die
        ../../gcc-trunk/gcc/dwarf2out.c:20378
0x97ef9d gen_struct_or_union_type_die
        ../../gcc-trunk/gcc/dwarf2out.c:20483
0x97ef9d gen_tagged_type_die
        ../../gcc-trunk/gcc/dwarf2out.c:20684
0x9805ed gen_type_die_with_usage
        ../../gcc-trunk/gcc/dwarf2out.c:20846
0x981186 gen_type_die
        ../../gcc-trunk/gcc/dwarf2out.c:20901
0x98d7c1 gen_decl_die
        ../../gcc-trunk/gcc/dwarf2out.c:21487
0x98e27c dwarf2out_decl
        ../../gcc-trunk/gcc/dwarf2out.c:21937
0x98e5ab dwarf2out_type_decl
        ../../gcc-trunk/gcc/dwarf2out.c:21647
0xbbcbff rest_of_type_compilation(tree_node*, int)
        ../../gcc-trunk/gcc/passes.c:339
0x6a47ac finish_struct_1(tree_node*)
        ../../gcc-trunk/gcc/cp/class.c:6747
0x6a61e4 finish_struct(tree_node*, tree_node*)
        ../../gcc-trunk/gcc/cp/class.c:6913
0x6df81b cp_parser_class_specifier_1
        ../../gcc-trunk/gcc/cp/parser.c:20443
0x6df81b cp_parser_class_specifier
        ../../gcc-trunk/gcc/cp/parser.c:20671
0x6df81b cp_parser_type_specifier
        ../../gcc-trunk/gcc/cp/parser.c:15076
0x6ef4ab cp_parser_decl_specifier_seq
        ../../gcc-trunk/gcc/cp/parser.c:12042
0x703d10 cp_parser_simple_declaration
        ../../gcc-trunk/gcc/cp/parser.c:11608
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
$


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


union U
{
  int x;
  float y;
} __attribute__ ((__transparent_union__));


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

* [Bug c/67580] Improve error message on missing "struct" tag
  2015-09-14 22:41 [Bug c/67580] New: Improve error message on missing "struct" tag chengniansun at gmail dot com
@ 2015-09-15  0:17 ` manu at gcc dot gnu.org
  2015-09-15 17:19 ` mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: manu at gcc dot gnu.org @ 2015-09-15  0:17 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 12564 bytes --]

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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-09-15
                 CC|                            |manu at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
Perhaps after failing to find type 'S' and before giving the error, it could
try to find 'struct S' and 'union S' (perhaps even enum S) using lookup_tag()
in c-decl.c.
>From gcc-bugs-return-497217-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Sep 15 05:07:35 2015
Return-Path: <gcc-bugs-return-497217-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 73759 invoked by alias); 15 Sep 2015 05:07:34 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 71443 invoked by uid 48); 15 Sep 2015 05:07:27 -0000
From: "zeccav at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/67484] options-save.c sanitizer asan detects freed storage referenced  heap-use-after-free
Date: Tue, 15 Sep 2015 05:07:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: zeccav at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: version
Message-ID: <bug-67484-4-vMY5d8riI1@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67484-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67484-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-09/txt/msg01195.txt.bz2
Content-length: 9763

https://gcc.gnu.org/bugzilla/show_bug.cgi?idg484

Vittorio Zecca <zeccav at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|5.2.0                       |6.0

--- Comment #1 from Vittorio Zecca <zeccav at gmail dot com> ---
Same bug on the trunk.
The following is the sanitizer output:

~/1tb/vitti/local/gcc-trunk-sanitized/bin/g++ -S gccerr26.C
=================================================================%114==ERROR: AddressSanitizer: heap-use-after-free on address 0x602000005850
at pc 0x2b7d193c94a5 bp 0x7ffe44d41860 sp 0x7ffe44d41010
READ of size 1 at 0x602000005850 thread T0
    #0 0x2b7d193c94a4 in __interceptor_strcmp
../../../../gcc-5.2.0/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:178
    #1 0x170f87f in cl_target_option_eq(cl_target_option const*,
cl_target_option const*) /home/vitti/test/gcc-sanitized/gcc/options-save.c:3491
    #2 0x202ee44 in cl_option_hasher::equal(tree_node*, tree_node*)
../../gcc/gcc/tree.c:11866
    #3 0x204559b in hash_table<cl_option_hasher,
xcallocator>::find_slot_with_hash(tree_node* const&, unsigned int,
insert_option) ../../gcc/gcc/hash-table.h:838
    #4 0x2042095 in hash_table<cl_option_hasher,
xcallocator>::find_slot(tree_node* const&, insert_option)
../../gcc/gcc/hash-table.h:408
    #5 0x202efc4 in build_target_option_node(gcc_options*)
../../gcc/gcc/tree.c:11914
    #6 0x21218b0 in ix86_valid_target_attribute_tree(tree_node*, gcc_options*,
gcc_options*) ../../gcc/gcc/config/i386/i386.c:5110
    #7 0x21af79c in get_builtin_code_for_version
../../gcc/gcc/config/i386/i386.c:34678
    #8 0x21b00b2 in ix86_compare_version_priority
../../gcc/gcc/config/i386/i386.c:34846
    #9 0x780078 in joust ../../gcc/gcc/cp/call.c:9234
    #10 0x781a8e in tourney ../../gcc/gcc/cp/call.c:9361
    #11 0x7544bf in perform_overload_resolution ../../gcc/gcc/cp/call.c:4016
    #12 0x754942 in build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, bool, int) ../../gcc/gcc/cp/call.c:4089
    #13 0xb66c40 in finish_call_expr(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, bool, bool, int) ../../gcc/gcc/cp/semantics.c:2391
    #14 0xa0b32a in cp_parser_postfix_expression ../../gcc/gcc/cp/parser.c:6422
    #15 0xa0fec8 in cp_parser_unary_expression ../../gcc/gcc/cp/parser.c:7486
    #16 0xa11a49 in cp_parser_cast_expression ../../gcc/gcc/cp/parser.c:8122
    #17 0xa11bb4 in cp_parser_binary_expression ../../gcc/gcc/cp/parser.c:8223
    #18 0xa13696 in cp_parser_assignment_expression
../../gcc/gcc/cp/parser.c:8481
    #19 0xa14197 in cp_parser_constant_expression
../../gcc/gcc/cp/parser.c:8727
    #20 0xa42158 in cp_parser_initializer_clause
../../gcc/gcc/cp/parser.c:19925
    #21 0xa41e9b in cp_parser_initializer ../../gcc/gcc/cp/parser.c:19866
    #22 0xa3813e in cp_parser_init_declarator ../../gcc/gcc/cp/parser.c:17793
    #23 0xa215bc in cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:11681
    #24 0xa210aa in cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:11555
    #25 0xa208bb in cp_parser_declaration ../../gcc/gcc/cp/parser.c:11452
    #26 0xa1fe63 in cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:11334
    #27 0xa0181d in cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:4154
    #28 0xa843f8 in c_parse_file() ../../gcc/gcc/cp/parser.c:34273
    #29 0xdb2e46 in c_common_parse_file() ../../gcc/gcc/c-family/c-opts.c:1058
    #30 0x19b8f12 in compile_file ../../gcc/gcc/toplev.c:544
    #31 0x19bf8f0 in do_compile ../../gcc/gcc/toplev.c:2034
    #32 0x19bff60 in toplev::main(int, char**) ../../gcc/gcc/toplev.c:2141
    #33 0x2d332c0 in main ../../gcc/gcc/main.c:39
    #34 0x390da1ffdf in __libc_start_main (/lib64/libc.so.6+0x390da1ffdf)
    #35 0x737768
(/home/vitti/1tb/vitti/local/gcc-trunk-sanitized/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/cc1plus+0x737768)

0x602000005850 is located 0 bytes inside of 6-byte region
[0x602000005850,0x602000005856)
freed by thread T0 here:
    #0 0x2b7d194171dd in __interceptor_free
../../../../gcc-5.2.0/libsanitizer/asan/asan_malloc_linux.cc:28
    #1 0x21219df in ix86_valid_target_attribute_tree(tree_node*, gcc_options*,
gcc_options*) ../../gcc/gcc/config/i386/i386.c:5118
    #2 0x2121e77 in ix86_valid_target_attribute_p
../../gcc/gcc/config/i386/i386.c:5166
    #3 0xd5e237 in handle_target_attribute
../../gcc/gcc/c-family/c-common.c:9777
    #4 0xce2e48 in decl_attributes(tree_node**, tree_node*, int)
../../gcc/gcc/attribs.c:557
    #5 0x9a5e3a in cplus_decl_attributes(tree_node**, tree_node*, int)
../../gcc/gcc/cp/decl2.c:1493
    #6 0x7d65a7 in grokfndecl ../../gcc/gcc/cp/decl.c:8100
    #7 0x7ea399 in grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**) ../../gcc/gcc/cp/decl.c:11265
    #8 0x7bcb26 in start_decl(cp_declarator const*, cp_decl_specifier_seq*,
int, tree_node*, tree_node*, tree_node**) ../../gcc/gcc/cp/decl.c:4740
    #9 0xa37c1f in cp_parser_init_declarator ../../gcc/gcc/cp/parser.c:17717
    #10 0xa215bc in cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:11681
    #11 0xa210aa in cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:11555
    #12 0xa208bb in cp_parser_declaration ../../gcc/gcc/cp/parser.c:11452
    #13 0xa1fe63 in cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:11334
    #14 0xa0181d in cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:4154
    #15 0xa843f8 in c_parse_file() ../../gcc/gcc/cp/parser.c:34273
    #16 0xdb2e46 in c_common_parse_file() ../../gcc/gcc/c-family/c-opts.c:1058
    #17 0x19b8f12 in compile_file ../../gcc/gcc/toplev.c:544
    #18 0x19bf8f0 in do_compile ../../gcc/gcc/toplev.c:2034
    #19 0x19bff60 in toplev::main(int, char**) ../../gcc/gcc/toplev.c:2141
    #20 0x2d332c0 in main ../../gcc/gcc/main.c:39
    #21 0x390da1ffdf in __libc_start_main (/lib64/libc.so.6+0x390da1ffdf)

previously allocated by thread T0 here:
    #0 0x2b7d19417509 in __interceptor_malloc
../../../../gcc-5.2.0/libsanitizer/asan/asan_malloc_linux.cc:38
    #1 0x2e6d27c in xmalloc ../../gcc/libiberty/xmalloc.c:147
    #2 0x2e6d41f in xstrdup ../../gcc/libiberty/xstrdup.c:34
    #3 0x2121028 in ix86_valid_target_attribute_inner_p
../../gcc/gcc/config/i386/i386.c:5017
    #4 0x21206da in ix86_valid_target_attribute_inner_p
../../gcc/gcc/config/i386/i386.c:4909
    #5 0x2121474 in ix86_valid_target_attribute_tree(tree_node*, gcc_options*,
gcc_options*) ../../gcc/gcc/config/i386/i386.c:5066
    #6 0x2121e77 in ix86_valid_target_attribute_p
../../gcc/gcc/config/i386/i386.c:5166
    #7 0xd5e237 in handle_target_attribute
../../gcc/gcc/c-family/c-common.c:9777
    #8 0xce2e48 in decl_attributes(tree_node**, tree_node*, int)
../../gcc/gcc/attribs.c:557
    #9 0x9a5e3a in cplus_decl_attributes(tree_node**, tree_node*, int)
../../gcc/gcc/cp/decl2.c:1493
    #10 0x7d65a7 in grokfndecl ../../gcc/gcc/cp/decl.c:8100
    #11 0x7ea399 in grokdeclarator(cp_declarator const*,
cp_decl_specifier_seq*, decl_context, int, tree_node**)
../../gcc/gcc/cp/decl.c:11265
    #12 0x7bcb26 in start_decl(cp_declarator const*, cp_decl_specifier_seq*,
int, tree_node*, tree_node*, tree_node**) ../../gcc/gcc/cp/decl.c:4740
    #13 0xa37c1f in cp_parser_init_declarator ../../gcc/gcc/cp/parser.c:17717
    #14 0xa215bc in cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:11681
    #15 0xa210aa in cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:11555
    #16 0xa208bb in cp_parser_declaration ../../gcc/gcc/cp/parser.c:11452
    #17 0xa1fe63 in cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:11334
    #18 0xa0181d in cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:4154
    #19 0xa843f8 in c_parse_file() ../../gcc/gcc/cp/parser.c:34273
    #20 0xdb2e46 in c_common_parse_file() ../../gcc/gcc/c-family/c-opts.c:1058
    #21 0x19b8f12 in compile_file ../../gcc/gcc/toplev.c:544
    #22 0x19bf8f0 in do_compile ../../gcc/gcc/toplev.c:2034
    #23 0x19bff60 in toplev::main(int, char**) ../../gcc/gcc/toplev.c:2141
    #24 0x2d332c0 in main ../../gcc/gcc/main.c:39
    #25 0x390da1ffdf in __libc_start_main (/lib64/libc.so.6+0x390da1ffdf)

SUMMARY: AddressSanitizer: heap-use-after-free
../../../../gcc-5.2.0/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:178
__interceptor_strcmp
Shadow bytes around the buggy address:
  0x0c047fff8ab0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8ac0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8ad0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8ae0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8af0: fa fa fa fa fa fa 06 fa fa fa fd fa fa fa fd fd
=>0x0c047fff8b00: fa fa fd fa fa fa fd fd fa fa[fd]fa fa fa fd fd
  0x0c047fff8b10: fa fa fd fa fa fa fd fd fa fa fd fd fa fa 00 06
  0x0c047fff8b20: fa fa 00 00 fa fa 00 01 fa fa 00 01 fa fa 00 01
  0x0c047fff8b30: fa fa 00 01 fa fa 00 01 fa fa 00 01 fa fa 00 01
  0x0c047fff8b40: fa fa 00 01 fa fa 00 fa fa fa 00 07 fa fa fd fd
  0x0c047fff8b50: fa fa 00 07 fa fa 00 07 fa fa 00 04 fa fa fd fd
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
=%114=«ORTING


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

* [Bug c/67580] Improve error message on missing "struct" tag
  2015-09-14 22:41 [Bug c/67580] New: Improve error message on missing "struct" tag chengniansun at gmail dot com
  2015-09-15  0:17 ` [Bug c/67580] " manu at gcc dot gnu.org
@ 2015-09-15 17:19 ` mpolacek at gcc dot gnu.org
  2015-09-15 17:20 ` mpolacek at gcc dot gnu.org
  2015-09-17 23:34 ` manu at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-09-15 17:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Tue Sep 15 17:19:11 2015
New Revision: 227803

URL: https://gcc.gnu.org/viewcvs?rev=227803&root=gcc&view=rev
Log:
        PR c/67580
        * c-decl.c (tag_exists_p): New function.
        * c-parser.c (c_parser_declaration_or_fndef): Give a hint when
        struct/union/enum keywords are missing.
        * c-tree.h (tag_exists_p): Declare.

        * gcc.dg/pr67580.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr67580.c
Modified:
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-decl.c
    trunk/gcc/c/c-parser.c
    trunk/gcc/c/c-tree.h
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c/67580] Improve error message on missing "struct" tag
  2015-09-14 22:41 [Bug c/67580] New: Improve error message on missing "struct" tag chengniansun at gmail dot com
  2015-09-15  0:17 ` [Bug c/67580] " manu at gcc dot gnu.org
  2015-09-15 17:19 ` mpolacek at gcc dot gnu.org
@ 2015-09-15 17:20 ` mpolacek at gcc dot gnu.org
  2015-09-17 23:34 ` manu at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-09-15 17:20 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

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

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.


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

* [Bug c/67580] Improve error message on missing "struct" tag
  2015-09-14 22:41 [Bug c/67580] New: Improve error message on missing "struct" tag chengniansun at gmail dot com
                   ` (2 preceding siblings ...)
  2015-09-15 17:20 ` mpolacek at gcc dot gnu.org
@ 2015-09-17 23:34 ` manu at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: manu at gcc dot gnu.org @ 2015-09-17 23:34 UTC (permalink / raw)
  To: gcc-bugs

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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rui.maciel at gmail dot com

--- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
*** Bug 55613 has been marked as a duplicate of this bug. ***
>From gcc-bugs-return-497466-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Sep 17 23:37:00 2015
Return-Path: <gcc-bugs-return-497466-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 78471 invoked by alias); 17 Sep 2015 23:37:00 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 78440 invoked by uid 48); 17 Sep 2015 23:36:56 -0000
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/67617] Non-standard const requirements imposed on associative container comparison objects
Date: Thu, 17 Sep 2015 23:37:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 4.8.4
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: redi at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-67617-4-Tchsed6dEw@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67617-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67617-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-09/txt/msg01444.txt.bz2
Content-length: 188

https://gcc.gnu.org/bugzilla/show_bug.cgi?idg617

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Both Clang/libc++ and MSVC/Dinkumware reject it for the same reason.


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

end of thread, other threads:[~2015-09-17 23:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-14 22:41 [Bug c/67580] New: Improve error message on missing "struct" tag chengniansun at gmail dot com
2015-09-15  0:17 ` [Bug c/67580] " manu at gcc dot gnu.org
2015-09-15 17:19 ` mpolacek at gcc dot gnu.org
2015-09-15 17:20 ` mpolacek at gcc dot gnu.org
2015-09-17 23:34 ` manu 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).