Bug 55246 - Define a macro for 16*1024*1024 in i386.c
Summary: Define a macro for 16*1024*1024 in i386.c
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.8.0
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: internal-improvement
Depends on:
Blocks:
 
Reported: 2012-11-09 01:44 UTC by H.J. Lu
Modified: 2021-08-16 23:15 UTC (History)
2 users (show)

See Also:
Host:
Target: i?86-*-* x86_64-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed: 2021-08-16 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2012-11-09 01:44:05 UTC
i386 backend has

i386.c:	      || INTVAL (op1) >= 16*1024*1024
i386.c:	      || INTVAL (op1) < -16*1024*1024)
i386.c:		  if (INTVAL (op1) < -16*1024*1024
i386.c:		      || INTVAL (op1) >= 16*1024*1024)
predicates.md:		  && offset < 16*1024*1024
predicates.md:		  && offset < 16*1024*1024

It is a magic number for 64-bit displacement.  We should define
a macro to make it consistent.
Comment 1 Eric Botcazou 2012-11-09 10:07:01 UTC
This occurred to me as well.
Comment 2 Andrew Pinski 2012-12-09 01:10:28 UTC
I don't understand why you just did not post a patch for this.
Comment 3 Andrew Pinski 2021-08-16 23:13:21 UTC
i386/i386.c:      if (INTVAL (op1) >= 16*1024*1024
i386/i386.c:          || INTVAL (op1) < -16*1024*1024)
i386/i386.c:              if (INTVAL (op1) < -16*1024*1024
i386/i386.c:                  || INTVAL (op1) >= 16*1024*1024)
i386/i386.c:              if (INTVAL (new_rtx) < -16*1024*1024
i386/i386.c:                  || INTVAL (new_rtx) >= 16*1024*1024)
i386/i386.c:           && INTVAL (disp) < -16*1024*1024)
i386/i386.c:         displacements if they < -16*1024*1024, which is also used
i386/predicates.md:               && offset < 16*1024*1024)
i386/predicates.md:               && offset < 16*1024*1024)

Still there today.