public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/37617]  New: gcc 4.4 regression: ICE on valid code
@ 2008-09-22 20:19 edwintorok at gmail dot com
  2008-09-22 20:20 ` [Bug rtl-optimization/37617] " edwintorok at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: edwintorok at gmail dot com @ 2008-09-22 20:19 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1489 bytes --]

I get an ICE using SVN version 140562:
~/gcc_inst/bin/gcc testcase-min.i -O1
testcase-min.i: In function ‘test_token_dval’:
testcase-min.i:19: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

This does not happen with my previous build of gcc 4.4 SVN r140456:
$ x86_64-unknown-linux-gnu-gcc-4.4.0 -O1 test.i -c
$

$ ~/gcc_inst/bin/gcc -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc/configure --enable-languages=c --disable-multilib
--disable-bootstrap --disable-static --prefix=/home/edwin/gcc_inst/
Thread model: posix
gcc version 4.4.0 20080922 (experimental) (GCC)

$ x86_64-unknown-linux-gnu-gcc-4.4.0 -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc/configure --enable-languages=c --disable-multilib
Thread model: posix
gcc version 4.4.0 20080918 (experimental) (GCC)


-- 
           Summary: gcc 4.4 regression: ICE on valid code
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: edwintorok at gmail dot com
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37617


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

* [Bug rtl-optimization/37617] gcc 4.4 regression: ICE on valid code
  2008-09-22 20:19 [Bug rtl-optimization/37617] New: gcc 4.4 regression: ICE on valid code edwintorok at gmail dot com
@ 2008-09-22 20:20 ` edwintorok at gmail dot com
  2008-09-22 20:36 ` [Bug rtl-optimization/37617] [4.4 Regression] " rguenth at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: edwintorok at gmail dot com @ 2008-09-22 20:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from edwintorok at gmail dot com  2008-09-22 20:18 -------
/* testcase compile this with -O1 */
typedef struct TCase TCase;
typedef void (*TFun) (int);
typedef struct Suite Suite;
void _tcase_add_test (TCase * tc, TFun tf, const char *fname, int signal,
                      int start, int end);
void _fail_unless (int result, const char *file, int line, const char *expr,
                   ...);
enum val_type
{
  vtype_undefined, vtype_cstring, vtype_string, vtype_scope, vtype_dval,
    vtype_ival
};
typedef struct token
{
  union
  {
    char *string;
    double dval;
  }
  val;
  enum val_type vtype;
}
yystype;
static int
vtype_compatible (enum val_type orig, enum val_type req)
{
}

static void
test_token_dval (int _i __attribute__ ((unused)))
{
  {
    int val = 0.12345;
    yystype tok;
    do
      {
        (&tok)->val.dval = (val);
      }
    while (0);
    _fail_unless ((vtype_compatible ((&tok)->vtype, vtype_string) ? (&tok)->
                   val.string : ((void *) 0)) == ((void *) 0),
                  "../../../trunk/unit_tests/check_jsnorm.c", 150,
                  "Assertion '" "TOKEN_GET(&tok, string) == NULL" "' failed",
                  "token dval->string", ((void *) 0));
  }
}

Suite *
test_jsnorm_suite (void)
{
  TCase *tc_jsnorm_gperf, *tc_jsnorm_token, *tc_jsnorm_api,
    *tc_jsnorm_tokenizer, *tc_jsnorm_bugs, *tc_screnc_infloop;
  _tcase_add_test ((tc_jsnorm_token), (test_token_dval),
                   "" "test_token_dval" "", (0), 0, 1);
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37617


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

* [Bug rtl-optimization/37617] [4.4 Regression] ICE on valid code
  2008-09-22 20:19 [Bug rtl-optimization/37617] New: gcc 4.4 regression: ICE on valid code edwintorok at gmail dot com
  2008-09-22 20:20 ` [Bug rtl-optimization/37617] " edwintorok at gmail dot com
@ 2008-09-22 20:36 ` rguenth at gcc dot gnu dot org
  2008-09-22 21:01 ` [Bug tree-optimization/37617] " pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-09-22 20:36 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
            Summary|gcc 4.4 regression: ICE on  |[4.4 Regression] ICE on
                   |valid code                  |valid code
   Target Milestone|---                         |4.4.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37617


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

* [Bug tree-optimization/37617] [4.4 Regression] ICE on valid code
  2008-09-22 20:19 [Bug rtl-optimization/37617] New: gcc 4.4 regression: ICE on valid code edwintorok at gmail dot com
  2008-09-22 20:20 ` [Bug rtl-optimization/37617] " edwintorok at gmail dot com
  2008-09-22 20:36 ` [Bug rtl-optimization/37617] [4.4 Regression] " rguenth at gcc dot gnu dot org
@ 2008-09-22 21:01 ` pinskia at gcc dot gnu dot org
  2008-09-22 21:11 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-09-22 21:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2008-09-22 21:00 -------
This worked with:
gcc version 4.4.0 20080917 (experimental) [trunk revision 140434] (GCC) 

But fails with:
GNU C (GCC) version 4.4.0 20080922 (experimental) [trunk revision 140563]
(i386-apple-darwin8.11.1)

The ICE is in bitmap_insert_into_set_1.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org, pinskia at gcc dot gnu
                   |                            |dot org
          Component|rtl-optimization            |tree-optimization


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37617


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

* [Bug tree-optimization/37617] [4.4 Regression] ICE on valid code
  2008-09-22 20:19 [Bug rtl-optimization/37617] New: gcc 4.4 regression: ICE on valid code edwintorok at gmail dot com
                   ` (2 preceding siblings ...)
  2008-09-22 21:01 ` [Bug tree-optimization/37617] " pinskia at gcc dot gnu dot org
@ 2008-09-22 21:11 ` pinskia at gcc dot gnu dot org
  2008-10-01 13:45 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-09-22 21:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2008-09-22 21:09 -------
Reduced even further and will reproduce with both LP32 and LP64 targets (as
long as float is 32bits and double is 64bits):
typedef union
{
  char *string;
  double dval;
  float fval;
} yystype;
char *f(void)
{
  yystype tok;
  tok.dval = 0;
  return (tok.string);
}
char *f1(void)
{
  yystype tok;
  tok.fval = 0;
  return (tok.string);
}


--- CUT ---
This was most likely introduced with the value numbering of unions.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-09-22 21:09:59
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37617


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

* [Bug tree-optimization/37617] [4.4 Regression] ICE on valid code
  2008-09-22 20:19 [Bug rtl-optimization/37617] New: gcc 4.4 regression: ICE on valid code edwintorok at gmail dot com
                   ` (3 preceding siblings ...)
  2008-09-22 21:11 ` pinskia at gcc dot gnu dot org
@ 2008-10-01 13:45 ` rguenth at gcc dot gnu dot org
  2008-10-01 16:25 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-10-01 13:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2008-10-01 13:44 -------
Indeed.  This exposes a bug as we do not fold VIEW_CONVERT_EXPR <char *> (0.0).
As we never initialize NEW_SETS for FRE we should not try to add to it.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-09-22 21:09:59         |2008-10-01 13:44:26
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37617


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

* [Bug tree-optimization/37617] [4.4 Regression] ICE on valid code
  2008-09-22 20:19 [Bug rtl-optimization/37617] New: gcc 4.4 regression: ICE on valid code edwintorok at gmail dot com
                   ` (4 preceding siblings ...)
  2008-10-01 13:45 ` rguenth at gcc dot gnu dot org
@ 2008-10-01 16:25 ` rguenth at gcc dot gnu dot org
  2008-10-01 16:26 ` rguenth at gcc dot gnu dot org
  2008-10-01 16:45 ` edwintorok at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-10-01 16:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenth at gcc dot gnu dot org  2008-10-01 16:24 -------
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

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


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37617


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

* [Bug tree-optimization/37617] [4.4 Regression] ICE on valid code
  2008-09-22 20:19 [Bug rtl-optimization/37617] New: gcc 4.4 regression: ICE on valid code edwintorok at gmail dot com
                   ` (5 preceding siblings ...)
  2008-10-01 16:25 ` rguenth at gcc dot gnu dot org
@ 2008-10-01 16:26 ` rguenth at gcc dot gnu dot org
  2008-10-01 16:45 ` edwintorok at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-10-01 16:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from rguenth at gcc dot gnu dot org  2008-10-01 16:24 -------
Subject: Bug 37617

Author: rguenth
Date: Wed Oct  1 16:23:23 2008
New Revision: 140816

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140816
Log:
2008-10-01  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/37617
        * tree-ssa-pre.c (create_expression_by_pieces): During FRE
        do not add to the NEW_SETS.

        * gcc.c-torture/compile/pr37617.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr37617.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-pre.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37617


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

* [Bug tree-optimization/37617] [4.4 Regression] ICE on valid code
  2008-09-22 20:19 [Bug rtl-optimization/37617] New: gcc 4.4 regression: ICE on valid code edwintorok at gmail dot com
                   ` (6 preceding siblings ...)
  2008-10-01 16:26 ` rguenth at gcc dot gnu dot org
@ 2008-10-01 16:45 ` edwintorok at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: edwintorok at gmail dot com @ 2008-10-01 16:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from edwintorok at gmail dot com  2008-10-01 16:43 -------
Thanks, gcc4.4 doesn't crash anymore now.


-- 

edwintorok at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |VERIFIED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37617


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

end of thread, other threads:[~2008-10-01 16:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-22 20:19 [Bug rtl-optimization/37617] New: gcc 4.4 regression: ICE on valid code edwintorok at gmail dot com
2008-09-22 20:20 ` [Bug rtl-optimization/37617] " edwintorok at gmail dot com
2008-09-22 20:36 ` [Bug rtl-optimization/37617] [4.4 Regression] " rguenth at gcc dot gnu dot org
2008-09-22 21:01 ` [Bug tree-optimization/37617] " pinskia at gcc dot gnu dot org
2008-09-22 21:11 ` pinskia at gcc dot gnu dot org
2008-10-01 13:45 ` rguenth at gcc dot gnu dot org
2008-10-01 16:25 ` rguenth at gcc dot gnu dot org
2008-10-01 16:26 ` rguenth at gcc dot gnu dot org
2008-10-01 16:45 ` edwintorok at gmail dot com

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).