public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/34205]  New: iwmmxt type/size error
@ 2007-11-23 10:58 aldot at gcc dot gnu dot org
  2007-11-23 10:59 ` [Bug bootstrap/34205] " aldot at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: aldot at gcc dot gnu dot org @ 2007-11-23 10:58 UTC (permalink / raw)
  To: gcc-bugs

With current trunk:

In file included from toolchain_build_armeb_nofp
u/gcc-4.3.0/gcc/c-lang.c:26:
toolchain_build_armeb_nofpu/gcc-4.3.0/gcc/tree.h:371: error: width of 'code'
exceeds its type


Works if omitting -march=iwmmxt -mabi=iwmmxt


Sample:
/there/build_armeb/staging_dir/usr/bin/armeb-linux-uclibcgnueabi-gcc
-march=iwmmxt -mabi=iwmmxt -I/there/build_armeb/staging_dir/usr/include
-I/there/build_armeb/staging_dir/include
--sysroot=/there/build_armeb/staging_dir/ -isysroot
/there/build_armeb/staging_dir  -I/there/build_armeb/staging_dir/usr/include
-I/there/build_armeb/staging_dir/include
--sysroot=/there/build_armeb/staging_dir/ -isysroot
/there/build_armeb/staging_dir -fno-common   -DHAVE_CONFIG_H -I. -I.
-I/there/toolchain_build_armeb_nofpu/gcc-4.3.0/gcc
-I/there/toolchain_build_armeb_nofpu/gcc-4.3.0/gcc/.
-I/there/toolchain_build_armeb_nofpu/gcc-4.3.0/gcc/../include
-I/there/toolchain_build_armeb_nofpu/gcc-4.3.0/gcc/../libcpp/include
-I/there/build_armeb/gmp-4.2.2/include -I/there/build_armeb/mpfr-2.3.0/include
-I/there/toolchain_build_armeb_nofpu/gcc-4.3.0/gcc/../libdecnumber
-I/there/toolchain_build_armeb_nofpu/gcc-4.3.0/gcc/../libdecnumber/dpd
-I../libdecnumber    pr.c -o argh2.o -c
pr.c:201: error: width of 'code' exceeds its type


-- 
           Summary: iwmmxt type/size error
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: build
          Severity: normal
          Priority: P3
         Component: bootstrap
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: aldot at gcc dot gnu dot org
 GCC build triplet: armeb-linux-*gnueabi
  GCC host triplet: i386-linux-gnu
GCC target triplet: armeb-linux-*gnueabi


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


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

* [Bug bootstrap/34205] iwmmxt type/size error
  2007-11-23 10:58 [Bug bootstrap/34205] New: iwmmxt type/size error aldot at gcc dot gnu dot org
@ 2007-11-23 10:59 ` aldot at gcc dot gnu dot org
  2007-11-26 13:50 ` drow at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: aldot at gcc dot gnu dot org @ 2007-11-23 10:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from aldot at gcc dot gnu dot org  2007-11-23 10:59 -------
Created an attachment (id=14625)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14625&action=view)
reduced from gcc/tree.h


-- 


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


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

* [Bug bootstrap/34205] iwmmxt type/size error
  2007-11-23 10:58 [Bug bootstrap/34205] New: iwmmxt type/size error aldot at gcc dot gnu dot org
  2007-11-23 10:59 ` [Bug bootstrap/34205] " aldot at gcc dot gnu dot org
@ 2007-11-26 13:50 ` drow at gcc dot gnu dot org
  2007-11-26 17:09 ` aldot at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: drow at gcc dot gnu dot org @ 2007-11-26 13:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from drow at gcc dot gnu dot org  2007-11-26 13:50 -------
I don't know how you configured to get this.  It looks like you've got
-fshort-enums by default; GCC can not be built with that option (although it
should be fixable).


-- 


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


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

* [Bug bootstrap/34205] iwmmxt type/size error
  2007-11-23 10:58 [Bug bootstrap/34205] New: iwmmxt type/size error aldot at gcc dot gnu dot org
  2007-11-23 10:59 ` [Bug bootstrap/34205] " aldot at gcc dot gnu dot org
  2007-11-26 13:50 ` drow at gcc dot gnu dot org
@ 2007-11-26 17:09 ` aldot at gcc dot gnu dot org
  2007-11-26 17:12 ` aldot at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: aldot at gcc dot gnu dot org @ 2007-11-26 17:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from aldot at gcc dot gnu dot org  2007-11-26 17:09 -------
I don't see an explicit -fshort-enums in my flags..

I'm using this:
CFLAGS_FOR_TARGET="-Os -pipe -fno-tree-loop-optimize -fno-tree-dominator-opts
-fno-strength-reduce -fno-branch-count-reg 
-I/there/build_armeb/staging_dir/usr/include
-I/there/build_armeb/staging_dir/include
--sysroot=/there/build_armeb/staging_dir/ -isysroot
/there/build_armeb/staging_dir -mtune=iwmmxt -march=iwmmxt -mabi=iwmmxt
-msoft-float -mfloat-abi=soft" \
/there/toolchain_build_armeb_nofpu/gcc-4.3.0/configure \
                --prefix=/usr \
                --build=i386-pc-linux-gnu \
                --host=armeb-linux-uclibcgnueabi \
                --target=armeb-linux-uclibcgnueabi \
                --enable-languages=c,fortran \
                --with-gxx-include-dir=/usr/include/c++ \
                --disable-__cxa_atexit \
                --with-gnu-ld \
                --enable-shared \
                --with-gmp="/there/build_armeb/gmp-4.2.2" \
                --with-mpfr="/there/build_armeb/mpfr-2.3.0" \
                --disable-nls \
                --enable-threads \
                --disable-multilib \
                --with-float=soft


-- 


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


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

* [Bug bootstrap/34205] iwmmxt type/size error
  2007-11-23 10:58 [Bug bootstrap/34205] New: iwmmxt type/size error aldot at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-11-26 17:09 ` aldot at gcc dot gnu dot org
@ 2007-11-26 17:12 ` aldot at gcc dot gnu dot org
  2007-11-27 19:27 ` drow at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: aldot at gcc dot gnu dot org @ 2007-11-26 17:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from aldot at gcc dot gnu dot org  2007-11-26 17:11 -------
While the configure explicitely lists armeb, the very same thing happens for
arm(el), fwiw.
Does perhaps one of -m{arch,abi}=iwmmxt imply -fshort-enums ?


-- 


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


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

* [Bug bootstrap/34205] iwmmxt type/size error
  2007-11-23 10:58 [Bug bootstrap/34205] New: iwmmxt type/size error aldot at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-11-26 17:12 ` aldot at gcc dot gnu dot org
@ 2007-11-27 19:27 ` drow at gcc dot gnu dot org
  2007-11-27 19:49 ` aldot at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: drow at gcc dot gnu dot org @ 2007-11-27 19:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from drow at gcc dot gnu dot org  2007-11-27 19:27 -------
Probably.  Why are you using the iwmmxt ABI?  Don't.  Just trust the AAPCS, it
knows what's good for you.


-- 


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


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

* [Bug bootstrap/34205] iwmmxt type/size error
  2007-11-23 10:58 [Bug bootstrap/34205] New: iwmmxt type/size error aldot at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-11-27 19:27 ` drow at gcc dot gnu dot org
@ 2007-11-27 19:49 ` aldot at gcc dot gnu dot org
  2007-11-27 20:15 ` aldot at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: aldot at gcc dot gnu dot org @ 2007-11-27 19:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from aldot at gcc dot gnu dot org  2007-11-27 19:48 -------
I ment to build with arch=tune=abi for iwmmxt
As you say, arm.c suggests that iwmmxt defaults to -fshort-enums here, fwiw:

/* AAPCS based ABIs use short enums by default.  */

static bool
arm_default_short_enums (void)
{
  return TARGET_AAPCS_BASED && arm_abi != ARM_ABI_AAPCS_LINUX;
}

I'll see if turning on "int enums" per default (which i thought was mandated by
C) for building GCC does what i intend.


-- 


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


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

* [Bug bootstrap/34205] iwmmxt type/size error
  2007-11-23 10:58 [Bug bootstrap/34205] New: iwmmxt type/size error aldot at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2007-11-27 19:49 ` aldot at gcc dot gnu dot org
@ 2007-11-27 20:15 ` aldot at gcc dot gnu dot org
  2007-11-28  0:11 ` raj dot khem at gmail dot com
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: aldot at gcc dot gnu dot org @ 2007-11-27 20:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from aldot at gcc dot gnu dot org  2007-11-27 20:15 -------
s/int//. The enumerated type is implementation defined but shall be capable to
represent the values of all members.

I'd read this as -fshort-enum violating that ":16"?


-- 


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


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

* [Bug bootstrap/34205] iwmmxt type/size error
  2007-11-23 10:58 [Bug bootstrap/34205] New: iwmmxt type/size error aldot at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2007-11-27 20:15 ` aldot at gcc dot gnu dot org
@ 2007-11-28  0:11 ` raj dot khem at gmail dot com
  2007-11-28 14:47 ` aldot at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: raj dot khem at gmail dot com @ 2007-11-28  0:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from raj dot khem at gmail dot com  2007-11-28 00:11 -------
(In reply to comment #7)
> s/int//. The enumerated type is implementation defined but shall be capable to
> represent the values of all members.

Exactly and gcc for arm uses this definition to its advantage so that it can
save some size.

> 
> I'd read this as -fshort-enum violating that ":16"?
> 

GCC can smartly chose type based on enum values for size reasons and it will
choose the smallest type that can represent the enum. In this testcase enum can
be represented by a char.
with
__extension__ enum tree_code code:16 

The testcase is asking for the bit-fields which are not defined for the enum
type that gcc has chosen So I think error is ok here.


-- 


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


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

* [Bug bootstrap/34205] iwmmxt type/size error
  2007-11-23 10:58 [Bug bootstrap/34205] New: iwmmxt type/size error aldot at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2007-11-28  0:11 ` raj dot khem at gmail dot com
@ 2007-11-28 14:47 ` aldot at gcc dot gnu dot org
  2007-11-28 16:40 ` raj dot khem at gmail dot com
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: aldot at gcc dot gnu dot org @ 2007-11-28 14:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from aldot at gcc dot gnu dot org  2007-11-28 14:47 -------
If the requested bitfield is larger than the type that was previously tried for
enum, then you have to widen the type to fulfill that constaint.


-- 


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


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

* [Bug bootstrap/34205] iwmmxt type/size error
  2007-11-23 10:58 [Bug bootstrap/34205] New: iwmmxt type/size error aldot at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2007-11-28 14:47 ` aldot at gcc dot gnu dot org
@ 2007-11-28 16:40 ` raj dot khem at gmail dot com
  2007-11-28 17:45 ` aldot at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: raj dot khem at gmail dot com @ 2007-11-28 16:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from raj dot khem at gmail dot com  2007-11-28 16:40 -------
(In reply to comment #9)
> If the requested bitfield is larger than the type that was previously tried for
> enum, then you have to widen the type to fulfill that constaint.
> 

is there a reference for this in the standards?


-- 


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


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

* [Bug bootstrap/34205] iwmmxt type/size error
  2007-11-23 10:58 [Bug bootstrap/34205] New: iwmmxt type/size error aldot at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2007-11-28 16:40 ` raj dot khem at gmail dot com
@ 2007-11-28 17:45 ` aldot at gcc dot gnu dot org
  2007-11-28 18:28 ` [Bug bootstrap/34205] enum " aldot at gcc dot gnu dot org
  2007-11-28 19:05 ` pbrook at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: aldot at gcc dot gnu dot org @ 2007-11-28 17:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from aldot at gcc dot gnu dot org  2007-11-28 17:44 -------
The standard (6.7.2.2, 4) talks about the note in #7.
I read this as for this input:
--------8<-------
enum e {ee};
struct s { __extension__ enum e baz:16; };
--------8<-------

The smallest type that can represent enum e has to be able to hold a bitfield
of 16, i.e.:

--------8<-------
enum e {__GCC_CONSTRAINT_ee=SHRT_MAX};
struct s { __extension__ enum e baz /*now implied :16*/; };

--------8<-------


-- 


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


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

* [Bug bootstrap/34205] enum type/size error
  2007-11-23 10:58 [Bug bootstrap/34205] New: iwmmxt type/size error aldot at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2007-11-28 17:45 ` aldot at gcc dot gnu dot org
@ 2007-11-28 18:28 ` aldot at gcc dot gnu dot org
  2007-11-28 19:05 ` pbrook at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: aldot at gcc dot gnu dot org @ 2007-11-28 18:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from aldot at gcc dot gnu dot org  2007-11-28 18:28 -------
Not target specific, adjusting accordingly.
Observed everywhere with -fshort-enums


-- 

aldot at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  GCC build triplet|arm-linux-*gnueabi          |
   GCC host triplet|i386-linux-gnu              |
 GCC target triplet|arm-linux-*gnueabi          |
           Keywords|                            |rejects-valid
            Summary|iwmmxt type/size error      |enum type/size error


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


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

* [Bug bootstrap/34205] enum type/size error
  2007-11-23 10:58 [Bug bootstrap/34205] New: iwmmxt type/size error aldot at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2007-11-28 18:28 ` [Bug bootstrap/34205] enum " aldot at gcc dot gnu dot org
@ 2007-11-28 19:05 ` pbrook at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: pbrook at gcc dot gnu dot org @ 2007-11-28 19:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from pbrook at gcc dot gnu dot org  2007-11-28 19:05 -------
The short answer is don't do that.

-mabi=iwmmxt selects a bare-metal (short-enum) AAPCS variant with iWMMXt
calling conventions. As such it is incompatible with the Linux EABI supplement
(http://www.codesourcery.com/gnu_toolchains/arm/arm_gnu_linux_abi.pdf) which
requires long-enums.

If you want iwmmxt calling conventions on linux you'll have to define and add a
new ABI variant.

In theory gcc should probably be fixed to support short-enum host systems.
In practice all vaguely interesting host systems use long enums, and other bits
of a linux system will explode if built with -fshort-enums, so I'm closing this
as WONTFIX.


-- 

pbrook at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WONTFIX


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


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

end of thread, other threads:[~2007-11-28 19:05 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-23 10:58 [Bug bootstrap/34205] New: iwmmxt type/size error aldot at gcc dot gnu dot org
2007-11-23 10:59 ` [Bug bootstrap/34205] " aldot at gcc dot gnu dot org
2007-11-26 13:50 ` drow at gcc dot gnu dot org
2007-11-26 17:09 ` aldot at gcc dot gnu dot org
2007-11-26 17:12 ` aldot at gcc dot gnu dot org
2007-11-27 19:27 ` drow at gcc dot gnu dot org
2007-11-27 19:49 ` aldot at gcc dot gnu dot org
2007-11-27 20:15 ` aldot at gcc dot gnu dot org
2007-11-28  0:11 ` raj dot khem at gmail dot com
2007-11-28 14:47 ` aldot at gcc dot gnu dot org
2007-11-28 16:40 ` raj dot khem at gmail dot com
2007-11-28 17:45 ` aldot at gcc dot gnu dot org
2007-11-28 18:28 ` [Bug bootstrap/34205] enum " aldot at gcc dot gnu dot org
2007-11-28 19:05 ` pbrook at gcc dot gnu dot 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).