[Bug c/52653] New: GCC 4.6.* bug on i386 Linux and mingw platforms

2012-03-21 Thread borut.razem at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52653

 Bug #: 52653
   Summary: GCC 4.6.* bug on i386 Linux and mingw platforms
Classification: Unclassified
   Product: gcc
   Version: 4.6.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: borut.ra...@gmail.com


The following code hangs the gcc 4.6.* compiler on i386 Linux and mingw
platforms.

Content of t.c:
8<
#define double2ul(val)  (((val) < 0) ? (((val) < -2147483647.0) ? 0x8000UL
: (unsigned long) -((long) -(val))) : (unsigned long) (val))

extern double bar ();

/* This seems to be a GCC 4.6.[012] bug on i386 Linux and mingw platforms
 */
void
foo (void)
{
  int x = 10 >> double2ul (bar ());
}
>8

Command:
gcc -c t.c

Compiler hangs on OS version:
$ uname -srvmpo
Linux 2.6.32-5-686 #1 SMP Wed Jan 11 12:29:30 UTC 2012 i686 unknown GNU/Linux

Compiler version:
$ gcc --version
gcc (GCC) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

It compiles correctly on OS version:
$ uname -srvmpo
Linux 3.0.0-16-generic #29-Ubuntu SMP Tue Feb 14 12:48:51 UTC 2012 x86_64
x86_64 GNU/Linux

Compiler version$ gcc --version
gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Borut


[Bug c/52655] New: right shit in switch: gcc compiles with error: label at end of compound statement

2012-03-21 Thread borut.razem at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52655

 Bug #: 52655
   Summary: right shit in switch: gcc compiles with error: label
at end of compound statement
Classification: Unclassified
   Product: gcc
   Version: 4.6.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: borut.ra...@gmail.com


The following code compiles with error: label at end of compound statement with
the gcc 4.6.1 compiler.

Content of t.c:
8<
void
foo (int op)
{
  int x = 10 >> 3;  /* OK */

  switch (op)
{
case 0:
  x = 10 >> 3;   /* t.c:12:5: error: label at end of compound
statement */
  break;

default:
}
}
>8

Command:
gcc -c t.c

Reproduced on OS version:
$ uname -srvmpo
Linux 2.6.32-5-686 #1 SMP Wed Jan 11 12:29:30 UTC 2012 i686 unknown GNU/Linux
and
Linux 3.0.0-16-generic #29-Ubuntu SMP Tue Feb 14 12:48:51 UTC 2012 x86_64
x86_64 GNU/Linux

Compiler version:
$ gcc --version
gcc (GCC) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

and
$ gcc --version
gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Borut


[Bug c/52655] confusing "error: label at end of compound statement" for default without statement

2012-03-21 Thread borut.razem at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52655

--- Comment #4 from Borut Ražem  2012-03-21 
12:44:34 UTC ---
What a shame :-(
Sorry for the false alarm.

Borut