public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/26427]  New: Regressions with -fsection-anchors with zero sized structs
@ 2006-02-22 18:58 pinskia at gcc dot gnu dot org
  2006-02-22 19:00 ` [Bug target/26427] " pinskia at gcc dot gnu dot org
                   ` (21 more replies)
  0 siblings, 22 replies; 25+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-22 18:58 UTC (permalink / raw)
  To: gcc-bugs

Testcase:
struct a {};
static const int d = 1;
static const struct a b = {};
static const int c = 1;
int f(const int *, const struct a *, const int*, const int*);
int g(void)
{
  return f(&c, &b, &d, &c);
}
int f(const int *b, const struct a *c, const int *d, const int *e)
{
  return *b == *d;
}
int main(void)
{
  if (!g())
    __builtin_abort();
}

-----
What is happening is that the size for b is being calcuated wrong in the anchor
code, I don't know how to fix this yet.


-- 
           Summary: Regressions with -fsection-anchors with zero sized
                    structs
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
GCC target triplet: powerpc-darwin
 BugsThisDependsOn: 26389


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


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

* [Bug target/26427] Regressions with -fsection-anchors with zero sized structs
  2006-02-22 18:58 [Bug target/26427] New: Regressions with -fsection-anchors with zero sized structs pinskia at gcc dot gnu dot org
@ 2006-02-22 19:00 ` pinskia at gcc dot gnu dot org
  2006-02-23  9:01 ` rsandifo at gcc dot gnu dot org
                   ` (20 subsequent siblings)
  21 siblings, 0 replies; 25+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-22 19:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-02-22 19:00 -------
This causes a lot of the gfortran testsuite to fail.


-- 


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


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

* [Bug target/26427] Regressions with -fsection-anchors with zero sized structs
  2006-02-22 18:58 [Bug target/26427] New: Regressions with -fsection-anchors with zero sized structs pinskia at gcc dot gnu dot org
  2006-02-22 19:00 ` [Bug target/26427] " pinskia at gcc dot gnu dot org
@ 2006-02-23  9:01 ` rsandifo at gcc dot gnu dot org
  2006-03-02 19:44 ` rsandifo at gcc dot gnu dot org
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 25+ messages in thread
From: rsandifo at gcc dot gnu dot org @ 2006-02-23  9:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rsandifo at gcc dot gnu dot org  2006-02-23 09:01 -------
In keeping with your choice of "target" category, I think this is a
Darwin-specific thing.  ASM_DECLARE_OBJECT_NAME() in config/darwin.h says:

    /* Darwin doesn't support zero-size objects, so give them a         \
       byte.  */                                                        \
    if (tree_low_cst (DECL_SIZE_UNIT (DECL), 1) == 0)                   \
      assemble_zeros (1);                                               \

Adding extra data behind varasm's back is going to play havoc with
any attempt to place objects correctly.

I'm considering adding equivalent code to varasm.c.  This will fix
an inconsistency in the handling of zero-sized decls: sometimes
they get a byte of storage allocated to them (giving them a unique
address) and sometimes they don't.

If the patch works out, I'll remove the code above.  Not assigning
myself until I get further though.


-- 

rsandifo at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rsandifo at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-02-23 09:01:26
               date|                            |


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


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

* [Bug target/26427] Regressions with -fsection-anchors with zero sized structs
  2006-02-22 18:58 [Bug target/26427] New: Regressions with -fsection-anchors with zero sized structs pinskia at gcc dot gnu dot org
  2006-02-22 19:00 ` [Bug target/26427] " pinskia at gcc dot gnu dot org
  2006-02-23  9:01 ` rsandifo at gcc dot gnu dot org
@ 2006-03-02 19:44 ` rsandifo at gcc dot gnu dot org
  2006-05-27  2:27 ` pinskia at gcc dot gnu dot org
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 25+ messages in thread
From: rsandifo at gcc dot gnu dot org @ 2006-03-02 19:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rsandifo at gcc dot gnu dot org  2006-03-02 19:44 -------
I said:

> I'm considering adding equivalent code to varasm.c.  This will fix
> an inconsistency in the handling of zero-sized decls: sometimes
> they get a byte of storage allocated to them (giving them a unique
> address) and sometimes they don't.

I'm no longer sure that's a good idea.  I suspect some users of
zero-sized structs really do want them to take zero size in the
object, and know which incantation they need to get that.

I'll have to leave the darwin.h ASM_DECLARE_OBJECT_NAME() issue
to someone with access to Darwin.

Richard


-- 


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


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

* [Bug target/26427] Regressions with -fsection-anchors with zero sized structs
  2006-02-22 18:58 [Bug target/26427] New: Regressions with -fsection-anchors with zero sized structs pinskia at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-03-02 19:44 ` rsandifo at gcc dot gnu dot org
@ 2006-05-27  2:27 ` pinskia at gcc dot gnu dot org
  2006-05-27  4:11 ` [Bug target/26427] [4.2 Regression] " pinskia at gcc dot gnu dot org
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 25+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-27  2:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2006-05-27 02:27 -------
*** Bug 27683 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dir at lanl dot gov


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


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

* [Bug target/26427] [4.2 Regression] with -fsection-anchors with zero sized structs
  2006-02-22 18:58 [Bug target/26427] New: Regressions with -fsection-anchors with zero sized structs pinskia at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2006-05-27  2:27 ` pinskia at gcc dot gnu dot org
@ 2006-05-27  4:11 ` pinskia at gcc dot gnu dot org
  2006-05-29 21:07 ` pinskia at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 25+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-27  4:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2006-05-27 04:11 -------
Created an attachment (id=11517)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11517&action=view)
patch which fixes part of the problem

This fixes the C testcase but it does not fix the Fortran issue but I don't
think the fortran issue is a target back-end issue now since
darwin_use_anchors_for_symbol_p does return false for the rtx.  I am off to the
bar for tonight so I cannot test this or fix the fortran issue.


-- 


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


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

* [Bug target/26427] [4.2 Regression] with -fsection-anchors with zero sized structs
  2006-02-22 18:58 [Bug target/26427] New: Regressions with -fsection-anchors with zero sized structs pinskia at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2006-05-27  4:11 ` [Bug target/26427] [4.2 Regression] " pinskia at gcc dot gnu dot org
@ 2006-05-29 21:07 ` pinskia at gcc dot gnu dot org
  2006-05-29 21:08 ` pinskia at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 25+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-29 21:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2006-05-29 21:06 -------
Created an attachment (id=11532)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11532&action=view)
new patch which again works around darwin back-end mess


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #11517|0                           |1
        is obsolete|                            |


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


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

* [Bug target/26427] [4.2 Regression] with -fsection-anchors with zero sized structs
  2006-02-22 18:58 [Bug target/26427] New: Regressions with -fsection-anchors with zero sized structs pinskia at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2006-05-29 21:07 ` pinskia at gcc dot gnu dot org
@ 2006-05-29 21:08 ` pinskia at gcc dot gnu dot org
  2006-05-29 23:04 ` howarth at nitro dot med dot uc dot edu
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 25+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-29 21:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2006-05-29 21:08 -------
Mike since you approved my orginal patch to fix some of -fsection-anchors and I
reported this bug back with that patch, could you look into fixing this?


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mrs at gcc dot gnu dot org


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


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

* [Bug target/26427] [4.2 Regression] with -fsection-anchors with zero sized structs
  2006-02-22 18:58 [Bug target/26427] New: Regressions with -fsection-anchors with zero sized structs pinskia at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2006-05-29 21:08 ` pinskia at gcc dot gnu dot org
@ 2006-05-29 23:04 ` howarth at nitro dot med dot uc dot edu
  2006-05-29 23:10 ` pinskia at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 25+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2006-05-29 23:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from howarth at nitro dot med dot uc dot edu  2006-05-29 23:04 -------
Andrew,
    I assume the new revised patch still only addresses the original PR 26427
test case
and doesn't resolve the gfortran testsuite failures in PR 27683. If PR 27683
isn't really
a duplicate of PR 26427 as you originally thought, shouldn't PR 27683 be
reopened?
         Jack


-- 


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


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

* [Bug target/26427] [4.2 Regression] with -fsection-anchors with zero sized structs
  2006-02-22 18:58 [Bug target/26427] New: Regressions with -fsection-anchors with zero sized structs pinskia at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2006-05-29 23:04 ` howarth at nitro dot med dot uc dot edu
@ 2006-05-29 23:10 ` pinskia at gcc dot gnu dot org
  2006-05-31  1:44 ` howarth at nitro dot med dot uc dot edu
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 25+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-29 23:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from pinskia at gcc dot gnu dot org  2006-05-29 23:10 -------
(In reply to comment #8)
Jack, it resolves both but it is just a hack around the fact that Darwin
back-end goes behind the middle-end to change the size of the
structs/arrays/string_csts to 1 from zero.


-- 


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


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

* [Bug target/26427] [4.2 Regression] with -fsection-anchors with zero sized structs
  2006-02-22 18:58 [Bug target/26427] New: Regressions with -fsection-anchors with zero sized structs pinskia at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2006-05-29 23:10 ` pinskia at gcc dot gnu dot org
@ 2006-05-31  1:44 ` howarth at nitro dot med dot uc dot edu
  2006-05-31 22:32 ` mrs at apple dot com
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 25+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2006-05-31  1:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from howarth at nitro dot med dot uc dot edu  2006-05-31 01:44 -------
Andrew,
   I can confirm that the proposed patch (with the missing null check) resolves
the new gfortran
failures on Darwin. Could you update the patch in this PR to revised version
with the null check
though. Hopefully we can get this into the trunk soon.
           Jack


-- 


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


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

* [Bug target/26427] [4.2 Regression] with -fsection-anchors with zero sized structs
  2006-02-22 18:58 [Bug target/26427] New: Regressions with -fsection-anchors with zero sized structs pinskia at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2006-05-31  1:44 ` howarth at nitro dot med dot uc dot edu
@ 2006-05-31 22:32 ` mrs at apple dot com
  2006-05-31 22:48 ` geoffk at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 25+ messages in thread
From: mrs at apple dot com @ 2006-05-31 22:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from mrs at apple dot com  2006-05-31 22:32 -------
I have a patch:

http://gcc.gnu.org/ml/gcc-patches/2006-05/msg01580.html

that I think fixes this problem.  I'd be cusious to hear if it fixes the
Fortran problem for you.


-- 

mrs at apple dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mrs at apple dot com


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


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

* [Bug target/26427] [4.2 Regression] with -fsection-anchors with zero sized structs
  2006-02-22 18:58 [Bug target/26427] New: Regressions with -fsection-anchors with zero sized structs pinskia at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2006-05-31 22:32 ` mrs at apple dot com
@ 2006-05-31 22:48 ` geoffk at gcc dot gnu dot org
  2006-06-01  0:05 ` howarth at nitro dot med dot uc dot edu
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 25+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2006-05-31 22:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from geoffk at gcc dot gnu dot org  2006-05-31 22:48 -------
The issue here is that Darwin does not support zero-sized objects in the
linker.  It just won't work.

So, you need to make sure that the linker never sees them.  This is presently
done for Darwin by adding a byte of padding at the end of every zero-sized
object.  Note that from the user's point of view, the structure is still zero
size; sizeof() will return 0.

If varasm.c needs to know about this, then this logic should move there.


-- 


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


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

* [Bug target/26427] [4.2 Regression] with -fsection-anchors with zero sized structs
  2006-02-22 18:58 [Bug target/26427] New: Regressions with -fsection-anchors with zero sized structs pinskia at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2006-05-31 22:48 ` geoffk at gcc dot gnu dot org
@ 2006-06-01  0:05 ` howarth at nitro dot med dot uc dot edu
  2006-06-01  0:22 ` howarth at nitro dot med dot uc dot edu
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 25+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2006-06-01  0:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from howarth at nitro dot med dot uc dot edu  2006-06-01 00:05 -------
Created an attachment (id=11561)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11561&action=view)
corrected patch as provided by Andrew


-- 


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


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

* [Bug target/26427] [4.2 Regression] with -fsection-anchors with zero sized structs
  2006-02-22 18:58 [Bug target/26427] New: Regressions with -fsection-anchors with zero sized structs pinskia at gcc dot gnu dot org
                   ` (12 preceding siblings ...)
  2006-06-01  0:05 ` howarth at nitro dot med dot uc dot edu
@ 2006-06-01  0:22 ` howarth at nitro dot med dot uc dot edu
  2006-06-01 21:49 ` geoffk at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 25+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2006-06-01  0:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from howarth at nitro dot med dot uc dot edu  2006-06-01 00:21 -------
Geoff,
    Then I assume you approve of Andrew Pinski's fix? I have uploaded the
corrected patch
that Andrew sent me which solves this problem in varasm.c. Or did you have a
different
approach in mind?
           Jack


-- 


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


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

* [Bug target/26427] [4.2 Regression] with -fsection-anchors with zero sized structs
  2006-02-22 18:58 [Bug target/26427] New: Regressions with -fsection-anchors with zero sized structs pinskia at gcc dot gnu dot org
                   ` (13 preceding siblings ...)
  2006-06-01  0:22 ` howarth at nitro dot med dot uc dot edu
@ 2006-06-01 21:49 ` geoffk at gcc dot gnu dot org
  2006-06-04 19:30 ` jsm28 at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 25+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2006-06-01 21:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from geoffk at gcc dot gnu dot org  2006-06-01 21:49 -------
After discussion with Mike, I don't think Andrew's fix is right either.

If varasm.c wants to be able to predict memory layout, then what it needs to do
is ensure that the memory layout is seen as a single unit by the linker.  This
can only be done by ensuring that the layout contains no linker-visible labels,
that is all the labels inside the layout must start with 'L'.  If this is done,
then the linker is not involved and zero-sized objects can be zero sized.


-- 


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


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

* [Bug target/26427] [4.2 Regression] with -fsection-anchors with zero sized structs
  2006-02-22 18:58 [Bug target/26427] New: Regressions with -fsection-anchors with zero sized structs pinskia at gcc dot gnu dot org
                   ` (14 preceding siblings ...)
  2006-06-01 21:49 ` geoffk at gcc dot gnu dot org
@ 2006-06-04 19:30 ` jsm28 at gcc dot gnu dot org
  2006-06-04 19:57 ` mmitchel at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 25+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2006-06-04 19:30 UTC (permalink / raw)
  To: gcc-bugs



-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.2.0


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


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

* [Bug target/26427] [4.2 Regression] with -fsection-anchors with zero sized structs
  2006-02-22 18:58 [Bug target/26427] New: Regressions with -fsection-anchors with zero sized structs pinskia at gcc dot gnu dot org
                   ` (15 preceding siblings ...)
  2006-06-04 19:30 ` jsm28 at gcc dot gnu dot org
@ 2006-06-04 19:57 ` mmitchel at gcc dot gnu dot org
  2006-06-08 22:23 ` mrs at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 25+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-06-04 19:57 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


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

* [Bug target/26427] [4.2 Regression] with -fsection-anchors with zero sized structs
  2006-02-22 18:58 [Bug target/26427] New: Regressions with -fsection-anchors with zero sized structs pinskia at gcc dot gnu dot org
                   ` (16 preceding siblings ...)
  2006-06-04 19:57 ` mmitchel at gcc dot gnu dot org
@ 2006-06-08 22:23 ` mrs at gcc dot gnu dot org
  2006-06-08 22:32 ` mrs at apple dot com
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 25+ messages in thread
From: mrs at gcc dot gnu dot org @ 2006-06-08 22:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from mrs at gcc dot gnu dot org  2006-06-08 22:23 -------
Subject: Bug 26427

Author: mrs
Date: Thu Jun  8 22:23:17 2006
New Revision: 114498

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114498
Log:
        PR target/26427
        * config/darwin.c (darwin_asm_output_anchor): Disable
        -fsection-anchors on darwin for now.
        * config/darwin.h (TARGET_ASM_OUTPUT_ANCHOR): Likewise.
        * rs6000/rs6000.c (optimization_options): Likewise.

testsuite:
        * gcc.dg/pr26427.c: Test to ensure that -fsection-anchors doesn't
        produce bad code on darwin.

Added:
    trunk/gcc/testsuite/gcc.dg/pr26427.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/darwin.c
    trunk/gcc/config/darwin.h
    trunk/gcc/config/rs6000/rs6000.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug target/26427] [4.2 Regression] with -fsection-anchors with zero sized structs
  2006-02-22 18:58 [Bug target/26427] New: Regressions with -fsection-anchors with zero sized structs pinskia at gcc dot gnu dot org
                   ` (17 preceding siblings ...)
  2006-06-08 22:23 ` mrs at gcc dot gnu dot org
@ 2006-06-08 22:32 ` mrs at apple dot com
  2006-06-08 22:45 ` mrs at apple dot com
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 25+ messages in thread
From: mrs at apple dot com @ 2006-06-08 22:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from mrs at apple dot com  2006-06-08 22:26 -------
This should be fixed now.


-- 


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


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

* [Bug target/26427] [4.2 Regression] with -fsection-anchors with zero sized structs
  2006-02-22 18:58 [Bug target/26427] New: Regressions with -fsection-anchors with zero sized structs pinskia at gcc dot gnu dot org
                   ` (18 preceding siblings ...)
  2006-06-08 22:32 ` mrs at apple dot com
@ 2006-06-08 22:45 ` mrs at apple dot com
  2006-06-08 23:02 ` pinskia at gcc dot gnu dot org
  2006-06-29 19:08 ` [Bug target/26427] " pinskia at gcc dot gnu dot org
  21 siblings, 0 replies; 25+ messages in thread
From: mrs at apple dot com @ 2006-06-08 22:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from mrs at apple dot com  2006-06-08 22:40 -------
The regression was introduced by:

2006-04-30  David Edelsohn  <edelsohn@gnu.org>

        * config/rs6000/rs6000.c (rs6000_override_options): Enable
        TARGET_NO_FP_IN_TOC for section anchors.
        (optimization_options): Enable section anchors for all
        non-"Objective" languages.


-- 


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


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

* [Bug target/26427] [4.2 Regression] with -fsection-anchors with zero sized structs
  2006-02-22 18:58 [Bug target/26427] New: Regressions with -fsection-anchors with zero sized structs pinskia at gcc dot gnu dot org
                   ` (19 preceding siblings ...)
  2006-06-08 22:45 ` mrs at apple dot com
@ 2006-06-08 23:02 ` pinskia at gcc dot gnu dot org
  2006-06-29 19:08 ` [Bug target/26427] " pinskia at gcc dot gnu dot org
  21 siblings, 0 replies; 25+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-06-08 23:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from pinskia at gcc dot gnu dot org  2006-06-08 22:45 -------
(In reply to comment #18)
> The regression was introduced by:
Exposed by and not introduced.  If you look at my patch which you approved, I
had mentioned this failure when I fixed most of -fsection-anchors for Darwin.


-- 


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


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

* [Bug target/26427] with -fsection-anchors with zero sized structs
  2006-02-22 18:58 [Bug target/26427] New: Regressions with -fsection-anchors with zero sized structs pinskia at gcc dot gnu dot org
                   ` (20 preceding siblings ...)
  2006-06-08 23:02 ` pinskia at gcc dot gnu dot org
@ 2006-06-29 19:08 ` pinskia at gcc dot gnu dot org
  21 siblings, 0 replies; 25+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-06-29 19:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #20 from pinskia at gcc dot gnu dot org  2006-06-29 18:58 -------
This has been worked arounded on the mainline.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.2 Regression] with -     |with -fsection-anchors with
                   |fsection-anchors with zero  |zero sized structs
                   |sized structs               |
   Target Milestone|4.2.0                       |---


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


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

* [Bug target/26427] with -fsection-anchors with zero sized structs
       [not found] <bug-26427-4@http.gcc.gnu.org/bugzilla/>
  2010-11-29 15:18 ` iains at gcc dot gnu.org
@ 2011-01-10 20:28 ` iains at gcc dot gnu.org
  1 sibling, 0 replies; 25+ messages in thread
From: iains at gcc dot gnu.org @ 2011-01-10 20:28 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Sandoe <iains at gcc dot gnu.org> changed:

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

--- Comment #22 from Iain Sandoe <iains at gcc dot gnu.org> 2011-01-10 20:26:19 UTC ---
fixed on trunk


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

* [Bug target/26427] with -fsection-anchors with zero sized structs
       [not found] <bug-26427-4@http.gcc.gnu.org/bugzilla/>
@ 2010-11-29 15:18 ` iains at gcc dot gnu.org
  2011-01-10 20:28 ` iains at gcc dot gnu.org
  1 sibling, 0 replies; 25+ messages in thread
From: iains at gcc dot gnu.org @ 2010-11-29 15:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #21 from Iain Sandoe <iains at gcc dot gnu.org> 2010-11-29 14:58:23 UTC ---
Author: iains
Date: Mon Nov 29 14:58:16 2010
New Revision: 167242

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167242
Log:

    PR target/26427
    PR target/33120
    PR testsuite/35710

gcc:
    * config/i386/darwin.h (ASM_OUTPUT_COMMON): Remove
    (ASM_OUTPUT_LOCAL): Likewise.
    * config/darwin-protos.h (darwin_asm_declare_object_name): New.
    (darwin_output_aligned_bss): Likewise.
    (darwin_asm_output_aligned_decl_local): Likewise.
    (darwin_asm_output_aligned_decl_common): Likewise.
    (darwin_use_anchors_for_symbol_p): Likewise.
    * config/rs6000/darwin.h (ASM_OUTPUT_COMMON): Remove.
    (TARGET_ASM_OUTPUT_ANCHOR): Define.
    (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Define.
    (DARWIN_SECTION_ANCHORS): Set to 1.
    * config/darwin.c (emit_aligned_common): New var.
    (darwin_init_sections): Check that the Darwin private zero-size section
    marker is in range.
    (darwin_text_section): Check for zero-sized objects.
    (darwin_mergeable_string_section): Likewise.
    (darwin_mergeable_constant_section): Likewise.
    (machopic_select_section): Adjust to check for zero-sized objects.
    Assert that OBJC meta data are non-zero sized.
    (darwin_asm_declare_object_name): New.
    (darwin_asm_declare_constant_name): Adjust for zero-sized
    object sections.
    (BYTES_ZFILL): Define.
    (darwin_emit_weak_or_comdat): New.
    (darwin_emit_local_bss): New.
    (darwin_emit_common): New.
    (darwin_output_aligned_bss): New.
    (darwin_asm_output_aligned_decl_common): New.
    (darwin_asm_output_aligned_decl_local): New.
    (darwin_file_end): Disable subsections_via_symbols when section
    anchoring is active.
    (darwin_asm_output_anchor): Re-enable.
    (darwin_use_anchors_for_symbol_p): New.
    (darwin_override_options): Check for versions that can emit
    aligned common.  Update usage of flags to current.
    * config/darwin-sections.def: Update comments and flags for
    non-anchor sections.  zobj_const_section, zobj_data_section,
    zobj_bss_section, zobj_const_data_section: New.
    * config/darwin.h (ASM_DECLARE_OBJECT_NAME): Redefine.
    (ASM_OUTPUT_ALIGN): Make whitespace output consistent.
    (L2_MAX_OFILE_ALIGNMENT): Define.
    (ASM_OUTPUT_ALIGNED_BSS): Define.
    (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Define.
    (ASM_OUTPUT_ALIGNED_DECL_COMMON): Define.
    (SECTION_NO_ANCHOR): Define.
    (TARGET_ASM_OUTPUT_ANCHOR) Define with a default of NULL.
    (DARWIN_SECTION_ANCHORS): Define with a default of 0.

boehm-gc:
    * dyn_load.c (GC_register_dynamic_libraries/DARWIN):  Add new writable
    data section names.
    (GC_dyld_name_for_hdr): Adjust layout.
    (GC_dyld_image_add): Adjust layout, add new Darwin sections, adjust
    debug to name the sections.
    (GC_dyld_image_remove): Adjust layout, remove new Darwin sections,
    adjust debug to name the sections.
    (GC_register_dynamic_libraries): Adjust layout.
    (GC_init_dyld): Likewise.
    (GC_register_main_static_data): Likewise.

gcc/testsuite:
    * gcc.target/powerpc/darwin-abi-12.c: Adjust for new allocators.
    * gcc.dg/pr26427.c: Remove redundant warning for powerpc.
    * gcc.dg/darwin-comm.c: Adjust for new allocators.
    * gcc.dg/darwin-sections.c: New test.
    * g++.dg/ext/instantiate2.C: Adjust for new allocators.


Added:
    trunk/gcc/testsuite/gcc.dg/darwin-sections.c
Modified:
    trunk/boehm-gc/ChangeLog
    trunk/boehm-gc/dyn_load.c
    trunk/gcc/ChangeLog
    trunk/gcc/config/darwin-protos.h
    trunk/gcc/config/darwin-sections.def
    trunk/gcc/config/darwin.c
    trunk/gcc/config/darwin.h
    trunk/gcc/config/i386/darwin.h
    trunk/gcc/config/rs6000/darwin.h
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/ext/instantiate2.C
    trunk/gcc/testsuite/gcc.dg/darwin-comm.c
    trunk/gcc/testsuite/gcc.dg/pr26427.c
    trunk/gcc/testsuite/gcc.target/powerpc/darwin-abi-12.c


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

end of thread, other threads:[~2011-01-10 20:26 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-22 18:58 [Bug target/26427] New: Regressions with -fsection-anchors with zero sized structs pinskia at gcc dot gnu dot org
2006-02-22 19:00 ` [Bug target/26427] " pinskia at gcc dot gnu dot org
2006-02-23  9:01 ` rsandifo at gcc dot gnu dot org
2006-03-02 19:44 ` rsandifo at gcc dot gnu dot org
2006-05-27  2:27 ` pinskia at gcc dot gnu dot org
2006-05-27  4:11 ` [Bug target/26427] [4.2 Regression] " pinskia at gcc dot gnu dot org
2006-05-29 21:07 ` pinskia at gcc dot gnu dot org
2006-05-29 21:08 ` pinskia at gcc dot gnu dot org
2006-05-29 23:04 ` howarth at nitro dot med dot uc dot edu
2006-05-29 23:10 ` pinskia at gcc dot gnu dot org
2006-05-31  1:44 ` howarth at nitro dot med dot uc dot edu
2006-05-31 22:32 ` mrs at apple dot com
2006-05-31 22:48 ` geoffk at gcc dot gnu dot org
2006-06-01  0:05 ` howarth at nitro dot med dot uc dot edu
2006-06-01  0:22 ` howarth at nitro dot med dot uc dot edu
2006-06-01 21:49 ` geoffk at gcc dot gnu dot org
2006-06-04 19:30 ` jsm28 at gcc dot gnu dot org
2006-06-04 19:57 ` mmitchel at gcc dot gnu dot org
2006-06-08 22:23 ` mrs at gcc dot gnu dot org
2006-06-08 22:32 ` mrs at apple dot com
2006-06-08 22:45 ` mrs at apple dot com
2006-06-08 23:02 ` pinskia at gcc dot gnu dot org
2006-06-29 19:08 ` [Bug target/26427] " pinskia at gcc dot gnu dot org
     [not found] <bug-26427-4@http.gcc.gnu.org/bugzilla/>
2010-11-29 15:18 ` iains at gcc dot gnu.org
2011-01-10 20:28 ` iains at gcc dot gnu.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).