This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/7] [ARC] Use -G option to control sdata behavior


* Claudiu Zissulescu <Claudiu.Zissulescu@synopsys.com> [2017-07-24 10:42:54 +0200]:

> From: claziss <claziss@synopsys.com>
> 
> Add support for -G option to ARC backend.
> 
> gcc/
> 2017-04-24  Claudiu Zissulescu  <claziss@synopsys.com>
> 
> 	* config.gcc: Use g.opt for arc.
> 	* config/arc/arc.c (LEGITIMATE_SCALED_ADDRESS_P): Deleted,
> 	functionality moved to ...
> 	(legitimate_scaled_address_p): New function, ...here.
> 	(LEGITIMATE_SMALL_DATA_OFFSET_P): New define.
> 	(LEGITIMATE_SMALL_DATA_ADDRESS_P): Use the above define.
> 	(legitimate_offset_address_p): Delete TARGET_NO_SDATA_SET
> 	condition.
> 	(arc_override_options): Handle G option.
> 	(arc_output_pic_addr_const): Correct function definition.
> 	(arc_legitimate_address_p): Use legitimate_scaled_address_p.
> 	(arc_decl_anon_ns_mem_p): Delete.
> 	(arc_in_small_data_p): Overhaul this function to take into
> 	consideration the value given via G option.
> 	(arc_rewrite_small_data_1): Renamed and corrected old
> 	arc_rewrite_small_data function.
> 	(arc_rewrite_small_data): New function.
> 	(small_data_pattern): Don't use pic_offset_table_rtx.
> 	* config/arc/arc.h (CC1_SPEC): Recognize G option.
> 	* config/arc/simdext.md (movmisalignv2hi): Use
> 	prepare_move_operands function.
> 	(mov*): Likewise.
> 	(movmisalign*): Likewise.
> 
> gcc/testsuite/
> 2017-04-24  Claudiu Zissulescu  <claziss@synopsys.com>
> 
> 	* gcc.target/arc/sdata-5.c: New test.
> 	* gcc.target/arc/arc700-stld-hazard.c: Update test options.

>From looking at other targets, I think that we need to add
documentation for -G into the ARC Options section of of
gcc/doc/invoke.texi.

> diff --git a/gcc/testsuite/gcc.target/arc/sdata-5.c b/gcc/testsuite/gcc.target/arc/sdata-5.c
> new file mode 100755
> index 0000000..0fdd52d
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/arc/sdata-5.c
> @@ -0,0 +1,8 @@
> +/* { dg-do compile } */
> +/* { dg-options "-w -Os" } */
> +
> +const a[1] = {};
> +static short b[] = {};
> +
> +c;
> +fn1() { return a + b[c]; }

Is it critical that we rely on default types here?  I know it's
legitimate, but it just makes me sad to see new code using default
types.

Also, I guess that this test expects some things to be placed into the
small data section? Is there no pattern we can 'scan-assembler' for?
Or is this testing some other feature / bug?

Otherwise seems fine.

Thanks,
Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]