This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFH] Fixing -fsection-anchors on powerpc-darwin


Since -fsection-anchors is very useful for PPC-Darwin, I decided to
see what I needed to do to support them.
I started by just doing a bootstrap with them enabled by default
and ran into the first issue of SET_ASM_OP not being set.  Next
I ran into the issue of quoting ". + 0" which caused the assembler
to think it is a symbol instead of an addition of . and 0.

The next issue I could not figure out how to fix, it is wrong code
caused by merging constant strings together.
Here is the reduced testcase (reduced from genmodes.c):
int modes;
emit_mode_class (void)
{
  int t;
  for(t = 0;t<modes;t++)
      __builtin_puts ("");
}
int main(void)
{
  char a[3] = "-h";
  if (!strcmp (a, "-h")) ; else  __builtin_abort ();
  emit_mode_class ();
}

If someone could look into this, it would be nice, I think the use
of .cstring and anchors are not supported together as .cstring section
can be merged.

There was another issue but I could not get to that issue with a normal
bootstrap but I could get to it with -j3.  The problem was I could not
figure out which file was causing the issue.

Thanks,
Andrew Pinski

PS Attached is the patch so far to support -fsection-anchors on ppc-darwin. I am unhappy about the quoting hack I had to do but it works.

Attachment: anchor.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]