Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
85775141
Commit
85775141
authored
Jun 11, 2019
by
Michael Meissner
Committed by
Michael Meissner
Jun 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not enable -mpcrel by default at the current time
From-SVN: r272165
parent
ce9c4ec3
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
51 additions
and
22 deletions
+51
-22
gcc/ChangeLog
+10
-0
gcc/config/rs6000/rs6000-cpus.def
+2
-2
gcc/config/rs6000/rs6000.c
+11
-8
gcc/testsuite/ChangeLog
+9
-0
gcc/testsuite/gcc.target/powerpc/localentry-1.c
+4
-3
gcc/testsuite/gcc.target/powerpc/localentry-detect-1.c
+4
-2
gcc/testsuite/gcc.target/powerpc/notoc-direct-1.c
+4
-3
gcc/testsuite/gcc.target/powerpc/pcrel-sibcall-1.c
+7
-4
No files found.
gcc/ChangeLog
View file @
85775141
2019-06-11 Michael Meissner <meissner@linux.ibm.com>
* config/rs6000/rs6000-cpus.def (ISA_FUTURE_MASKS_SERVER): Delete
enabling -mpcrel by default.
* config/rs6000/rs6000.c (rs6000_option_override_internal): Update
test for -mpcrel and/or -mprefixed-addr needing -mcpu=future, so
that the test against -mcpu=future is done first. Then test if
-mprefixed-addr is on for -mpcrel.
(rs6000_disable_incompatible_switches): Add -mcpu=future support.
2019-06-11 Jakub Jelinek <jakub@redhat.com>
2019-06-11 Jakub Jelinek <jakub@redhat.com>
PR target/90811
PR target/90811
...
...
gcc/config/rs6000/rs6000-cpus.def
View file @
85775141
...
@@ -75,10 +75,10 @@
...
@@ -75,10 +75,10 @@
| OPTION_MASK_P8_VECTOR \
| OPTION_MASK_P8_VECTOR \
| OPTION_MASK_P9_VECTOR)
| OPTION_MASK_P9_VECTOR)
/* Support for a future processor's features. */
/* Support for a future processor's features. Do not enable -mpcrel until it
is fully functional. */
#define ISA_FUTURE_MASKS_SERVER (ISA_3_0_MASKS_SERVER \
#define ISA_FUTURE_MASKS_SERVER (ISA_3_0_MASKS_SERVER \
| OPTION_MASK_FUTURE \
| OPTION_MASK_FUTURE \
| OPTION_MASK_PCREL \
| OPTION_MASK_PREFIXED_ADDR)
| OPTION_MASK_PREFIXED_ADDR)
/* Flags that need to be turned off if -mno-future. */
/* Flags that need to be turned off if -mno-future. */
...
...
gcc/config/rs6000/rs6000.c
View file @
85775141
...
@@ -4245,22 +4245,24 @@ rs6000_option_override_internal (bool global_init_p)
...
@@ -4245,22 +4245,24 @@ rs6000_option_override_internal (bool global_init_p)
rs6000_isa_flags
&=
~
OPTION_MASK_FLOAT128_HW
;
rs6000_isa_flags
&=
~
OPTION_MASK_FLOAT128_HW
;
}
}
/* -mp
crel requires prefixed load/store addressing
. */
/* -mp
refixed-addr (and hence -mpcrel) requires -mcpu=future
. */
if
(
TARGET_P
CREL
&&
!
TARGET_PREFIXED_ADDR
)
if
(
TARGET_P
REFIXED_ADDR
&&
!
TARGET_FUTURE
)
{
{
if
((
rs6000_isa_flags_explicit
&
OPTION_MASK_PCREL
)
!=
0
)
if
((
rs6000_isa_flags_explicit
&
OPTION_MASK_PCREL
)
!=
0
)
error
(
"%qs requires %qs"
,
"-mpcrel"
,
"-mprefixed-addr"
);
error
(
"%qs requires %qs"
,
"-mpcrel"
,
"-mcpu=future"
);
else
if
((
rs6000_isa_flags_explicit
&
OPTION_MASK_PREFIXED_ADDR
)
!=
0
)
error
(
"%qs requires %qs"
,
"-mprefixed-addr"
,
"-mcpu=future"
);
rs6000_isa_flags
&=
~
OPTION_MASK_PCREL
;
rs6000_isa_flags
&=
~
(
OPTION_MASK_PCREL
|
OPTION_MASK_PREFIXED_ADDR
)
;
}
}
/* -mp
refixed-addr (and hence -mpcrel) requires -mcpu=future
. */
/* -mp
crel requires prefixed load/store addressing
. */
if
(
TARGET_P
REFIXED_ADDR
&&
!
TARGET_FUTURE
)
if
(
TARGET_P
CREL
&&
!
TARGET_PREFIXED_ADDR
)
{
{
if
((
rs6000_isa_flags_explicit
&
OPTION_MASK_PCREL
)
!=
0
)
if
((
rs6000_isa_flags_explicit
&
OPTION_MASK_PCREL
)
!=
0
)
error
(
"%qs requires %qs"
,
"-mp
refixed-addr"
,
"-mcpu=future
"
);
error
(
"%qs requires %qs"
,
"-mp
crel"
,
"-mprefixed-addr
"
);
rs6000_isa_flags
&=
~
(
OPTION_MASK_PCREL
|
OPTION_MASK_PREFIXED_ADDR
)
;
rs6000_isa_flags
&=
~
OPTION_MASK_PCREL
;
}
}
/* Print the options after updating the defaults. */
/* Print the options after updating the defaults. */
...
@@ -37155,6 +37157,7 @@ rs6000_disable_incompatible_switches (void)
...
@@ -37155,6 +37157,7 @@ rs6000_disable_incompatible_switches (void)
const
HOST_WIDE_INT
dep_flags
;
/* flags that depend on this option. */
const
HOST_WIDE_INT
dep_flags
;
/* flags that depend on this option. */
const
char
*
const
name
;
/* name of the switch. */
const
char
*
const
name
;
/* name of the switch. */
}
flags
[]
=
{
}
flags
[]
=
{
{
OPTION_MASK_FUTURE
,
OTHER_FUTURE_MASKS
,
"future"
},
{
OPTION_MASK_P9_VECTOR
,
OTHER_P9_VECTOR_MASKS
,
"power9-vector"
},
{
OPTION_MASK_P9_VECTOR
,
OTHER_P9_VECTOR_MASKS
,
"power9-vector"
},
{
OPTION_MASK_P8_VECTOR
,
OTHER_P8_VECTOR_MASKS
,
"power8-vector"
},
{
OPTION_MASK_P8_VECTOR
,
OTHER_P8_VECTOR_MASKS
,
"power8-vector"
},
{
OPTION_MASK_VSX
,
OTHER_VSX_VECTOR_MASKS
,
"vsx"
},
{
OPTION_MASK_VSX
,
OTHER_VSX_VECTOR_MASKS
,
"vsx"
},
gcc/testsuite/ChangeLog
View file @
85775141
2019-06-11 Michael Meissner <meissner@linux.ibm.com>
* gcc.target/powerpc/localentry-1.c: Add -mpcrel option.
* gcc.target/powerpc/localentry-detect-1.c: Explicitly set and
unset -mpcrel in the target pragmas.
* gcc.target/powerpc/notoc-direct-1.c: Add -mpcrel option.
* gcc.target/powerpc/pcrel-sibcall-1.c: Explicitly set and
unset -mpcrel in the target pragmas.
2019-06-11 Marc Glisse <marc.glisse@inria.fr>
2019-06-11 Marc Glisse <marc.glisse@inria.fr>
* gcc.dg/tree-ssa/cmpexactdiv-5.c: New file.
* gcc.dg/tree-ssa/cmpexactdiv-5.c: New file.
...
...
gcc/testsuite/gcc.target/powerpc/localentry-1.c
View file @
85775141
/* { dg-do compile } */
/* { dg-do compile } */
/* { dg-options "-mdejagnu-cpu=future -O2" } */
/* { dg-options "-mdejagnu-cpu=future -O2
-mpcrel
" } */
/* { dg-require-effective-target powerpc_elfv2 } */
/* { dg-require-effective-target powerpc_elfv2 } */
/* { dg-require-effective-target powerpc_future_ok } */
/* { dg-require-effective-target powerpc_future_ok } */
/* Ensure we generate ".localentry fn,1" for both leaf and non-leaf
/* Ensure we generate ".localentry fn,1" for both leaf and non-leaf functions.
functions. */
At present, -mcpu=future does not enable pc-relative mode, so make sure we
enable it to be able to check for .localentry. */
extern
int
y
(
int
);
extern
int
y
(
int
);
...
...
gcc/testsuite/gcc.target/powerpc/localentry-detect-1.c
View file @
85775141
...
@@ -3,10 +3,12 @@
...
@@ -3,10 +3,12 @@
/* { dg-require-effective-target powerpc_future_ok } */
/* { dg-require-effective-target powerpc_future_ok } */
/* { dg-options "-O2 -mdejagnu-cpu=future" } */
/* { dg-options "-O2 -mdejagnu-cpu=future" } */
/* At present, -mcpu=future does not enable pc-relative mode. Enable it here
explicitly until it is turned on by default. */
#pragma GCC target ("cpu=future,pcrel")
int
localentry1
()
{
return
5
;
}
int
localentry1
()
{
return
5
;
}
#pragma GCC target ("cpu=power9")
#pragma GCC target ("cpu=power9
,no-pcrel
")
int
localentry2
()
{
return
5
;
}
int
localentry2
()
{
return
5
;
}
/* { dg-final { scan-assembler {\.localentry\tlocalentry1,1\M} } } */
/* { dg-final { scan-assembler {\.localentry\tlocalentry1,1\M} } } */
...
...
gcc/testsuite/gcc.target/powerpc/notoc-direct-1.c
View file @
85775141
/* { dg-do compile } */
/* { dg-do compile } */
/* { dg-options "-mdejagnu-cpu=future -O2" } */
/* { dg-options "-mdejagnu-cpu=future -O2
-mpcrel
" } */
/* { dg-require-effective-target powerpc_elfv2 } */
/* { dg-require-effective-target powerpc_elfv2 } */
/* { dg-require-effective-target powerpc_future_ok } */
/* { dg-require-effective-target powerpc_future_ok } */
/* Test that calls generated from PC-relative code are
/* Test that calls generated from PC-relative code are annotated with @notoc.
annotated with @notoc. */
At present, -mcpu=future does not enable pc-relative mode. Enable it here
explicitly until it is turned on by default. */
extern
int
yy0
(
int
);
extern
int
yy0
(
int
);
extern
void
yy1
(
int
);
extern
void
yy1
(
int
);
...
...
gcc/testsuite/gcc.target/powerpc/pcrel-sibcall-1.c
View file @
85775141
...
@@ -3,9 +3,12 @@
...
@@ -3,9 +3,12 @@
/* { dg-require-effective-target powerpc_elfv2 } */
/* { dg-require-effective-target powerpc_elfv2 } */
/* { dg-require-effective-target powerpc_future_ok } */
/* { dg-require-effective-target powerpc_future_ok } */
/* Test that potential sibcalls are not generated when the caller preserves
/* Test that potential sibcalls are not generated when the caller preserves the
the TOC and the callee doesn't, or vice versa. */
TOC and the callee doesn't, or vice versa. At present, -mcpu=future does
not enable pc-relative mode. Enable it here explicitly until it is turned
on by default. */
#pragma GCC target ("cpu=future,pcrel")
int
x
(
void
)
__attribute__
((
noinline
));
int
x
(
void
)
__attribute__
((
noinline
));
int
y
(
void
)
__attribute__
((
noinline
));
int
y
(
void
)
__attribute__
((
noinline
));
int
xx
(
void
)
__attribute__
((
noinline
));
int
xx
(
void
)
__attribute__
((
noinline
));
...
@@ -25,7 +28,7 @@ int sib_call (void)
...
@@ -25,7 +28,7 @@ int sib_call (void)
return
x
();
return
x
();
}
}
#pragma GCC target ("cpu=power9")
#pragma GCC target ("cpu=power9
,no-pcrel
")
int
normal_call
(
void
)
int
normal_call
(
void
)
{
{
return
y
();
return
y
();
...
@@ -36,7 +39,7 @@ int xx (void)
...
@@ -36,7 +39,7 @@ int xx (void)
return
1
;
return
1
;
}
}
#pragma GCC target ("cpu=future")
#pragma GCC target ("cpu=future
,pcrel
")
int
notoc_call
(
void
)
int
notoc_call
(
void
)
{
{
return
xx
();
return
xx
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment