public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/29413]  New: -EB / -EL don't properly affect gcc predefined symbols
@ 2006-10-10 14:13 ralf at linux-mips dot org
  2006-10-12  6:58 ` [Bug target/29413] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: ralf at linux-mips dot org @ 2006-10-10 14:13 UTC (permalink / raw)
  To: gcc-bugs

$ mips-linux-gcc -EL -dM -E -C -x c /dev/null | grep MIPSE
#define MIPSEB 1
#define __MIPSEB__ 1
#define _MIPSEB 1
#define __MIPSEB 1
$ mipsel-linux-gcc -EB -dM -E -C -x c /dev/null | grep MIPSE
#define __MIPSEL__ 1
#define MIPSEL 1
#define _MIPSEL 1
#define __MIPSEL 1
$ mips64el-linux-gcc -EB -dM -E -C -x c /dev/null | grep MIPSE
#define __MIPSEL__ 1
#define MIPSEL 1
#define _MIPSEL 1
#define __MIPSEL 1
$ mips64-linux-gcc -EL -dM -E -C -x c /dev/null | grep MIPSE
#define MIPSEB 1
#define __MIPSEB__ 1
#define _MIPSEB 1
#define __MIPSEB 1
$

Tested with gcc 4.1.0 but given the (incomplete) hacks the Linux/MIPS kernel
has for this I would assume it is broken since a very, very long time.


-- 
           Summary: -EB / -EL don't properly affect gcc predefined symbols
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ralf at linux-mips dot org
GCC target triplet: mips*-linux


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


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

* [Bug target/29413] -EB / -EL don't properly affect gcc predefined symbols
  2006-10-10 14:13 [Bug c/29413] New: -EB / -EL don't properly affect gcc predefined symbols ralf at linux-mips dot org
@ 2006-10-12  6:58 ` pinskia at gcc dot gnu dot org
  2006-10-12  7:05 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-12  6:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-10-12 06:58 -------
      if (TARGET_BIG_ENDIAN)                                    \
        {                                                       \
          builtin_define_std ("MIPSEB");                        \
          builtin_define ("_MIPSEB");                           \
        }                                                       \
      else                                                      \
        {                                                       \
          builtin_define_std ("MIPSEL");                        \
          builtin_define ("_MIPSEL");                           \
        }     



%{G*} %{EB:-meb} %{EL:-mel} %{EB:%{EL:%emay not use both -EB and -EL}} \


meb
Target Report RejectNegative Mask(BIG_ENDIAN)
Use big-endian byte order

mel
Target Report RejectNegative InverseMask(BIG_ENDIAN, LITTLE_ENDIAN)
Use little-endian byte order

It looks to me this should work.


-- 


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


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

* [Bug target/29413] -EB / -EL don't properly affect gcc predefined symbols
  2006-10-10 14:13 [Bug c/29413] New: -EB / -EL don't properly affect gcc predefined symbols ralf at linux-mips dot org
  2006-10-12  6:58 ` [Bug target/29413] " pinskia at gcc dot gnu dot org
@ 2006-10-12  7:05 ` pinskia at gcc dot gnu dot org
  2006-10-12  7:08 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-12  7:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-10-12 07:05 -------
[pinskia@celery gcc]$ ./xgcc -B. -EL -dM -E -C -x c /dev/null | grep MIPSE
#define __MIPSEL__ 1
#define MIPSEL 1
#define _MIPSEL 1
#define __MIPSEL 1
[pinskia@celery gcc]$ ./xgcc -B. -EB -dM -E -C -x c /dev/null | grep MIPSE
#define MIPSEB 1
#define __MIPSEB__ 1
#define _MIPSEB 1
#define __MIPSEB 1
[pinskia@celery gcc]$ ./xgcc -B. -EB -dM -E -C -x c /dev/null -v
Using built-in specs.
Target: mipsisa32-elf
Configured with: ../configure --target=mipsisa32-elf : (reconfigured)
Thread model: single
gcc version 4.0.4 20061010 (prerelease)

Hmm, If this does not work then the order of config/linux.h and
config/mips/mips.h are wrong and config/linux.h is being included first which
defines CC1_SPEC and then config/mips/mips.h checks to see if CC1_SPEC is
defined.


-- 


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


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

* [Bug target/29413] -EB / -EL don't properly affect gcc predefined symbols
  2006-10-10 14:13 [Bug c/29413] New: -EB / -EL don't properly affect gcc predefined symbols ralf at linux-mips dot org
  2006-10-12  6:58 ` [Bug target/29413] " pinskia at gcc dot gnu dot org
  2006-10-12  7:05 ` pinskia at gcc dot gnu dot org
@ 2006-10-12  7:08 ` pinskia at gcc dot gnu dot org
  2006-10-12  7:27 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-12  7:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-10-12 07:08 -------
Yep that is what is happening:
mips64*-*-linux*)
        tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h
mips/linux64.h"
        .....
        ;;
mips*-*-linux*)                         # Linux MIPS, either endian.
        tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h"
        ....
        esac
        ;;


-- 


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


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

* [Bug target/29413] -EB / -EL don't properly affect gcc predefined symbols
  2006-10-10 14:13 [Bug c/29413] New: -EB / -EL don't properly affect gcc predefined symbols ralf at linux-mips dot org
                   ` (2 preceding siblings ...)
  2006-10-12  7:08 ` pinskia at gcc dot gnu dot org
@ 2006-10-12  7:27 ` pinskia at gcc dot gnu dot org
  2006-10-12  7:29 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-12  7:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2006-10-12 07:27 -------
Actually it was only caused recently for mips-linux (non64bit):
2002-08-02  Eric Christopher  <echristo@redhat.com>

        * config.gcc (mips*-*-linux*): Fix ordering of tm_file.
        * config/mips/mips.h (READONLY_DATA_SECTION_ASM_OP): Change
        #ifndef to #undef.
        (TARGET_MEM_FUNCTIONS): Define instead of define to 1.

mips64-linux-gnu was always wrong.

The correct order was in
http://gcc.gnu.org/ml/gcc-patches/2002-07/msg01743.html
But was wrong before that patch
And then was broken again with
http://gcc.gnu.org/ml/gcc-patches/2002-08/msg00204.html

The not having the define means we are also creating wrong code.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 GCC target triplet|mips*-linux                 |mips*-linux*
           Keywords|                            |wrong-code


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


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

* [Bug target/29413] -EB / -EL don't properly affect gcc predefined symbols
  2006-10-10 14:13 [Bug c/29413] New: -EB / -EL don't properly affect gcc predefined symbols ralf at linux-mips dot org
                   ` (3 preceding siblings ...)
  2006-10-12  7:27 ` pinskia at gcc dot gnu dot org
@ 2006-10-12  7:29 ` pinskia at gcc dot gnu dot org
  2006-10-12  7:33 ` [Bug target/29413] -EB / -EL don't properly affect endian for Linux on MIPS pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-12  7:29 UTC (permalink / raw)
  To: gcc-bugs



-- 

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         |2006-10-12 07:29:04
               date|                            |


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


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

* [Bug target/29413] -EB / -EL don't properly affect endian for Linux on MIPS
  2006-10-10 14:13 [Bug c/29413] New: -EB / -EL don't properly affect gcc predefined symbols ralf at linux-mips dot org
                   ` (4 preceding siblings ...)
  2006-10-12  7:29 ` pinskia at gcc dot gnu dot org
@ 2006-10-12  7:33 ` pinskia at gcc dot gnu dot org
  2006-10-12 13:33 ` ralf at linux-mips dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-12  7:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2006-10-12 07:33 -------
*** Bug 23824 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ondrap at penguin dot cz


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


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

* [Bug target/29413] -EB / -EL don't properly affect endian for Linux on MIPS
  2006-10-10 14:13 [Bug c/29413] New: -EB / -EL don't properly affect gcc predefined symbols ralf at linux-mips dot org
                   ` (5 preceding siblings ...)
  2006-10-12  7:33 ` [Bug target/29413] -EB / -EL don't properly affect endian for Linux on MIPS pinskia at gcc dot gnu dot org
@ 2006-10-12 13:33 ` ralf at linux-mips dot org
  2006-10-12 14:11 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ralf at linux-mips dot org @ 2006-10-12 13:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from ralf at linux-mips dot org  2006-10-12 13:33 -------
> %{G*} %{EB:-meb} %{EL:-mel} %{EB:%{EL:%emay not use both -EB and -EL}} \

Shouldn't the combination of both -EB and -EL be legal that is later options
override preceeding ones just like with other -ffoo / -fno-foo options?


-- 


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


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

* [Bug target/29413] -EB / -EL don't properly affect endian for Linux on MIPS
  2006-10-10 14:13 [Bug c/29413] New: -EB / -EL don't properly affect gcc predefined symbols ralf at linux-mips dot org
                   ` (6 preceding siblings ...)
  2006-10-12 13:33 ` ralf at linux-mips dot org
@ 2006-10-12 14:11 ` pinskia at gcc dot gnu dot org
  2006-10-17  7:10 ` rsandifo at gcc dot gnu dot org
  2006-10-19 15:46 ` rsandifo at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-12 14:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2006-10-12 14:11 -------
(In reply to comment #6)
> > %{G*} %{EB:-meb} %{EL:-mel} %{EB:%{EL:%emay not use both -EB and -EL}} \
> 
> Shouldn't the combination of both -EB and -EL be legal that is later options
> override preceeding ones just like with other -ffoo / -fno-foo options?
That is not the problem, the problem is that CC1_SPEC does not contain the
above but instead the one that is in config/linux.h.


-- 


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


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

* [Bug target/29413] -EB / -EL don't properly affect endian for Linux on MIPS
  2006-10-10 14:13 [Bug c/29413] New: -EB / -EL don't properly affect gcc predefined symbols ralf at linux-mips dot org
                   ` (7 preceding siblings ...)
  2006-10-12 14:11 ` pinskia at gcc dot gnu dot org
@ 2006-10-17  7:10 ` rsandifo at gcc dot gnu dot org
  2006-10-19 15:46 ` rsandifo at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: rsandifo at gcc dot gnu dot org @ 2006-10-17  7:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from rsandifo at gcc dot gnu dot org  2006-10-17 07:10 -------
Fixed in trunk.  Because the patch is simple and fairly obvious,
I used the leeway given target maintainers to fix the bug for 4.2,
even though it isn't a regression.  However, because it's not a
regression, I don't think it's appropriate for release branches.

Richard


-- 

rsandifo at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to work|                            |4.2.0
         Resolution|                            |FIXED


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


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

* [Bug target/29413] -EB / -EL don't properly affect endian for Linux on MIPS
  2006-10-10 14:13 [Bug c/29413] New: -EB / -EL don't properly affect gcc predefined symbols ralf at linux-mips dot org
                   ` (8 preceding siblings ...)
  2006-10-17  7:10 ` rsandifo at gcc dot gnu dot org
@ 2006-10-19 15:46 ` rsandifo at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: rsandifo at gcc dot gnu dot org @ 2006-10-19 15:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from rsandifo at gcc dot gnu dot org  2006-10-19 15:45 -------
Subject: Bug 29413

Author: rsandifo
Date: Thu Oct 19 15:45:46 2006
New Revision: 117886

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117886
Log:
gcc/
        Backport from mainline:

        2006-10-17  Andrew Pinsiki  <pinskia@gmail.com>
                    Richard Sandiford  <richard@codesourcery.com>

        PR target/29413
        * config/mips/linux.h (SUBTARGET_CC1_SPEC): Override.
        * config/mips/mips.h (CC1_SPEC): Override any earlier definition.

Added:
    branches/csl/sourcerygxx-4_1/gcc/ChangeLog.csl
Modified:
    branches/csl/sourcerygxx-4_1/gcc/config/mips/linux.h
    branches/csl/sourcerygxx-4_1/gcc/config/mips/mips.h


-- 


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


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

end of thread, other threads:[~2006-10-19 15:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-10 14:13 [Bug c/29413] New: -EB / -EL don't properly affect gcc predefined symbols ralf at linux-mips dot org
2006-10-12  6:58 ` [Bug target/29413] " pinskia at gcc dot gnu dot org
2006-10-12  7:05 ` pinskia at gcc dot gnu dot org
2006-10-12  7:08 ` pinskia at gcc dot gnu dot org
2006-10-12  7:27 ` pinskia at gcc dot gnu dot org
2006-10-12  7:29 ` pinskia at gcc dot gnu dot org
2006-10-12  7:33 ` [Bug target/29413] -EB / -EL don't properly affect endian for Linux on MIPS pinskia at gcc dot gnu dot org
2006-10-12 13:33 ` ralf at linux-mips dot org
2006-10-12 14:11 ` pinskia at gcc dot gnu dot org
2006-10-17  7:10 ` rsandifo at gcc dot gnu dot org
2006-10-19 15:46 ` rsandifo 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).