Bug 56228 - [4.8 Regression] Indirect call fails to assemble
Summary: [4.8 Regression] Indirect call fails to assemble
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: 4.8.0
Assignee: Jakub Jelinek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-06 16:43 UTC by Jakub Jelinek
Modified: 2013-02-07 10:52 UTC (History)
1 user (show)

See Also:
Host:
Target: powerpc64-linux
Build:
Known to work:
Known to fail:
Last reconfirmed: 2013-02-06 00:00:00


Attachments
gcc48-pr56228.patch (952 bytes, patch)
2013-02-06 16:52 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelinek 2013-02-06 16:43:48 UTC
short a[14] = { 1, 2 };
short b[15] = { 3, 4 };

int
foo ()
{
  void (*fna) (void) = (void (*) (void)) a;
  void (*fnb) (void) = (void (*) (void)) b;
  fna ();
  fnb ();
  return a[1] == b[1];
}

fails on ppc64, because call_indirect_aix64bit pattern uses "m" constraint for 64-bit loads instead of "Y" constraint.
Comment 1 Jakub Jelinek 2013-02-06 16:52:56 UTC
Created attachment 29373 [details]
gcc48-pr56228.patch

Untested fix.
Comment 2 David Edelsohn 2013-02-06 18:15:17 UTC
The proposed patch LGTM.
Comment 3 Jakub Jelinek 2013-02-07 08:05:10 UTC
Author: jakub
Date: Thu Feb  7 08:04:58 2013
New Revision: 195840

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195840
Log:
	PR target/56228
	* config/rs6000/rs6000.md (ptrm): New mode attr.
	(call_indirect_aix<ptrsize>, call_indirect_aix<ptrsize>_nor11,
	call_value_indirect_aix<pttrsize>,
	call_value_indirect_aix<pttrsize>_nor11): Use <ptrm> instead of
	m in constraints.

	* gcc.dg/pr56228.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr56228.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/rs6000/rs6000.md
    trunk/gcc/testsuite/ChangeLog
Comment 4 Richard Biener 2013-02-07 10:52:47 UTC
Fixed.