This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: Add Epiphany port
On Thu, 3 Nov 2011, Joern Rennecke wrote:
> @@ -2723,7 +2723,8 @@ least version 2.20.1), and GNU C library
> @item long_call/short_call
> @cindex indirect calls on ARM
> This attribute specifies how a particular function is called on
> -ARM@. Both attributes override the @option{-mlong-calls} (@pxref{ARM Options})
> +ARM and Epiphany@. Both attributes override the
The @. is because of the capital letter at the end of ARM; it's not
necessary after Epiphany.
> +@table @gcctabopt
> +@item -mhalf-reg-file
> +@opindex mhalf-reg-file
> +Don't allocate any register in the range @code{r32} .. @code{r63} .
@dots{} for the range (or use an unspaced en dash), and no space before
the final ".".
> +@item -mstack-offse@var{num}
It appears to be -mstack-offset=@var{num}, not -mstack-offse@var{num}.
> +@opindex mstack-offset
> +Set the offset between the top of the stack and the stack pointer.
> +E.g. a value of 8 means that the eight bytes in the range sp+0.. sp+7
@: or comma after "e.g.". Same comment as above about "..".
> +truncating (i.e. round tgowards zero) rounding mode. That includes
@: or comma after "i.e.".
> Index: gcc/testsuite/gcc.dg/pragma-pack-3.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/pragma-pack-3.c (revision 180805)
> +++ gcc/testsuite/gcc.dg/pragma-pack-3.c (working copy)
> @@ -1,6 +1,6 @@
> /* PR c++/25294 */
> /* { dg-options "-std=gnu99" } */
> -/* { dg-do run } */
> +/* { dg-do run { target { ! epiphany-*-* } } } */
What's non-portable about this test? Whatever it is, an effective-target
keyword would be better than hardcoding a reference to the particular
target.
> Index: gcc/testsuite/gcc.dg/weak/typeof-2.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/weak/typeof-2.c (revision 180805)
> +++ gcc/testsuite/gcc.dg/weak/typeof-2.c (working copy)
> @@ -5,6 +5,7 @@
> /* { dg-require-weak "" } */
> /* { dg-require-alias "" } */
> /* { dg-options "-O2" } */
> +/* { dg-options "-O2 -mshort-calls" { target epiphany-*-* } } */
Comment about the reason for this option?
> Index: gcc/testsuite/gcc.dg/tls/thr-cse-1.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/tls/thr-cse-1.c (revision 180805)
> +++ gcc/testsuite/gcc.dg/tls/thr-cse-1.c (working copy)
> @@ -1,5 +1,6 @@
> /* { dg-do compile } */
> /* { dg-options "-O1" } */
> +/* { dg-options "-O1 -mshort-calls" { target epiphany-*-* } } */
Likewise.
> Index: gcc/testsuite/g++.dg/opt/devirt2.C
> ===================================================================
> --- gcc/testsuite/g++.dg/opt/devirt2.C (revision 180805)
> +++ gcc/testsuite/g++.dg/opt/devirt2.C (working copy)
> @@ -1,5 +1,6 @@
> // { dg-do compile }
> // { dg-options "-O2" }
> +// { dg-options "-O2 -mshort-calls" {target epiphany-*-*} }
> // { dg-final { scan-assembler-times "xyzzy" 2 { target { ! { alpha*-*-* hppa*-*-* ia64*-*-hpux* sparc*-*-* } } } } }
> // The IA64 and HPPA compilers generate external declarations in addition
> // to the call so those scans need to be more specific.
Likewise. Note there are already comments about some other targets.
> Index: gcc/testsuite/g++.dg/parse/pragma3.C
> ===================================================================
> --- gcc/testsuite/g++.dg/parse/pragma3.C (revision 180805)
> +++ gcc/testsuite/g++.dg/parse/pragma3.C (working copy)
> @@ -1,5 +1,5 @@
> // PR c++/25294
> -// { dg-do run }
> +// { dg-do run { target { ! epiphany-*-* } } }
Same comment about using an effective-target applies.
> Index: gcc/config.gcc
> ===================================================================
> --- gcc/config.gcc (revision 180805)
> +++ gcc/config.gcc (working copy)
> @@ -327,6 +327,9 @@
> crisv32-*)
> cpu_type=cris
> ;;
> +epiphany-*-*)
> + cpu_type=epiphany
> + ;;
Not needed; if there were epiphany* variant names it would be relevant,
but you aren't matching any such variants.
You should go through the checklist in sourcebuild.texi, Back End, and
fill in missing pieces, such as md.texi, contrib.texi, config-list.mk and
the website patches.
> + if (TREE_CODE (value) != STRING_CST)
> + {
> + warning (OPT_Wattributes,
> + "argument of %qs attribute is not a string constant",
> + IDENTIFIER_POINTER (name));
It's preferred to use %qE to print identifiers rather than using
IDENTIFIER_POINTER with %qs.
> + warning (OPT_Wattributes,
> + "argument of %qs attribute is not \"reset\", \"software_exception\", \"timer\", \"dma0\", \"dma1\", \"static_flag\" or \"swi\"",
> + IDENTIFIER_POINTER (name));
Likewise.
> +#define ASM_SPEC "%{v}"
ASM_SPEC doesn't need %{v}. See
<http://gcc.gnu.org/ml/gcc-patches/2010-12/msg00195.html>.
> +/* We would like to use Posix for profiling, but the simulator interface
> + lacks mkdir. */
> +#undef TARGET_POSIX_IO
This doesn't belong in a generic file for a given CPU. It might go in a
file for a (CPU, OS) combination - but it's the bare-metal default anyway.
--
Joseph S. Myers
joseph@codesourcery.com