public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hjl.tools at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/61914] [4.10 Regression] wide-int change breaks x32 bootstrap
Date: Mon, 28 Jul 2014 17:12:00 -0000	[thread overview]
Message-ID: <bug-61914-4-WigwZgfDq9@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61914-4@http.gcc.gnu.org/bugzilla/>

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|x32-*-*                     |
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-07-28
     Ever confirmed|0                           |1

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
It is a bug in gengtype.c where strtok(arg, ",>") is called
recursively on

generic_wide_int<fixed_wide_int_storage<int_traits<T1>::precision>>

defined in wide-int.h:

(gdb) bt
#0  strtok () at ../sysdeps/x86_64/strtok.S:198
#1  0x004027ec in create_user_defined_type (
    type_name=0x6402e0 "fixed_wide_int_storage<int_traits<T1", 
    pos=0x637a98 <lexer_line>) at /export/gnu/import/git/gcc/gcc/gengtype.c:593
#2  0x00402967 in resolve_typedef (
    s=0x6402e0 "fixed_wide_int_storage<int_traits<T1", 
    pos=0x637a98 <lexer_line>) at /export/gnu/import/git/gcc/gcc/gengtype.c:664
#3  0x004027b0 in create_user_defined_type (
    type_name=0x6401d0
"generic_wide_int<fixed_wide_int_storage<int_traits<T1>::precision>>",
pos=0x637a98 <lexer_line>)
    at /export/gnu/import/git/gcc/gcc/gengtype.c:591
#4  0x00402967 in resolve_typedef (
    s=0x6401d0
"generic_wide_int<fixed_wide_int_storage<int_traits<T1>::precision>>",
pos=0x637a98 <lexer_line>)
    at /export/gnu/import/git/gcc/gcc/gengtype.c:664
#5  0x00413e81 in type (optsp=0xffffd10c, nested=false)
    at /export/gnu/import/git/gcc/gcc/gengtype-parse.c:854
#6  0x00414239 in typedef_decl ()
    at /export/gnu/import/git/gcc/gcc/gengtype-parse.c:1013
#7  0x0041446d in parse_file (
    fname=0x6394b9 "/export/gnu/import/git/gcc/gcc/wide-int.h")
    at /export/gnu/import/git/gcc/gcc/gengtype-parse.c:1104
#8  0x0040f953 in main (argc=7, argv=0xffffd264)
---Type <return> to continue, or q <return> to quit---
    at /export/gnu/import/git/gcc/gcc/gengtype.c:5486
(gdb) 

create_user_defined_type calls

1. strtok (arg, ",>").
2. resolve_typedef (field_name, pos), which calls create_user_defined_type,
which calls strtok (arg, ",>") again.
3. strtok (0, ",>"), which uses the wrong saved pointer.


It is a pure luck that it fails only for x32.


  parent reply	other threads:[~2014-07-28 17:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-25 21:59 [Bug bootstrap/61914] New: " hjl.tools at gmail dot com
2014-07-28  8:27 ` [Bug bootstrap/61914] " rguenth at gcc dot gnu.org
2014-07-28 17:12 ` hjl.tools at gmail dot com [this message]
2014-07-28 17:22 ` hjl.tools at gmail dot com
2014-07-28 22:16 ` hjl.tools at gmail dot com
2014-07-29 16:23 ` [Bug bootstrap/61914] [4.10 Regression] wide-int change breaks bootstrap hjl at gcc dot gnu.org
2014-07-29 16:24 ` hjl.tools at gmail dot com

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-61914-4-WigwZgfDq9@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).