This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, MIPS] Fix PR target/68273, passing args in wrong regs
- From: Steve Ellcey <sellcey at imgtec dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: Mike Stump <mikestump at comcast dot net>, <gcc-patches at gcc dot gnu dot org>, "Richard Biener" <richard dot guenther at gmail dot com>, "Moore, Catherine" <Catherine_Moore at mentor dot com>, "Maciej W. Rozycki" <macro at imgtec dot com>, "Matthew Fortune" <Matthew dot Fortune at imgtec dot com>, Richard Sandiford <rdsandiford at googlemail dot com>
- Date: Thu, 4 Feb 2016 10:26:09 -0800
- Subject: Re: [Patch, MIPS] Fix PR target/68273, passing args in wrong regs
- Authentication-results: sourceware.org; auth=none
- References: <a80cfc11-c2a6-4142-b66f-a522f227d6ba at BAMAIL02 dot ba dot imgtec dot org> <1454538638 dot 3232 dot 125 dot camel at ubuntu-sellcey> <1E4CE37C-986B-4DEB-A936-BA9A6C117A0B at comcast dot net> <2455176 dot 3K2QFyxiOu at polaris>
- Reply-to: <sellcey at imgtec dot com>
On Thu, 2016-02-04 at 12:09 +0100, Eric Botcazou wrote:
> > So this doesn’t fix aarch64, c6x, epiphany, ia64, iq2000, rs6000, rx, sparc,
> > tilegx, tilepro or xtensa.
> > :-( That’s one of the problems by having each port copy and paste swaths of
> > :code from other ports to express the same thing instead of ports sharing
> > :just one copy of code. My port is also broken in the same way
> > :(currently).
>
> Yes, fixing a compiler bug by changing the ABI is a no-no, and the argument of
> the compatibility with LLVM has IMO little merit since it's a GCC extension.
But it is a GCC extension that is implemented in LLVM. It's just
implemented differently there. We either have to change GCC, change
LLVM, or live with the difference.
In any of these cases I wonder if we should change GCC so that the code
below generates warnings. If the two types are going to get passed
differently we shouldn't allow calls with one type to call a function
expecting the other type to happen with no warning or error. Currently
this code does not warn even with -Wall.
typedef int alignedint __attribute__((aligned(8)));
extern void foo (alignedint a);
extern void bar (int);
int a;
alignedint b;
int main()
{
foo(a);
bar(b);
}
Steve Ellcey
sellcey@imgtec.com