[PATCH][ARM] GCC command line support for Cortex-R7

2013-02-24 Thread Terry Guo
Hi,

This patch is to enable GCC to accept new command line option
-mcpu=cortex-r7. Is it OK to trunk?

BR,
Terry

2013-02-25  Terry Guo  

* config/arm/arm-cores.def: Added core cortex-r7.
* config/arm/arm-tune.md: Regenerated.
* config/arm/arm-tables.opt: Regenerated.
* doc/invoke.texi: Added entry for core cortex-r7.diff --git a/gcc/config/arm/arm-cores.def b/gcc/config/arm/arm-cores.def
index a4cb7c6..185f78e 100644
--- a/gcc/config/arm/arm-cores.def
+++ b/gcc/config/arm/arm-cores.def
@@ -132,6 +132,7 @@ ARM_CORE("cortex-a15",	  cortexa15,	7A, FL_LDSCHED | FL_THUMB_DIV | FL_ARM_D
 ARM_CORE("cortex-r4",	  cortexr4,	7R, FL_LDSCHED, cortex)
 ARM_CORE("cortex-r4f",	  cortexr4f,	7R, FL_LDSCHED, cortex)
 ARM_CORE("cortex-r5",	  cortexr5,	7R, FL_LDSCHED | FL_ARM_DIV, cortex)
+ARM_CORE("cortex-r7",	  cortexr7,	7R, FL_LDSCHED | FL_ARM_DIV, cortex)
 ARM_CORE("cortex-m4",	  cortexm4,	7EM, FL_LDSCHED, cortex)
 ARM_CORE("cortex-m3",	  cortexm3,	7M, FL_LDSCHED, cortex)
 ARM_CORE("cortex-m1",	  cortexm1,	6M, FL_LDSCHED, v6m)
diff --git a/gcc/config/arm/arm-tables.opt b/gcc/config/arm/arm-tables.opt
index 06a529d..ad52d18 100644
--- a/gcc/config/arm/arm-tables.opt
+++ b/gcc/config/arm/arm-tables.opt
@@ -259,6 +259,9 @@ EnumValue
 Enum(processor_type) String(cortex-r5) Value(cortexr5)
 
 EnumValue
+Enum(processor_type) String(cortex-r7) Value(cortexr7)
+
+EnumValue
 Enum(processor_type) String(cortex-m4) Value(cortexm4)
 
 EnumValue
diff --git a/gcc/config/arm/arm-tune.md b/gcc/config/arm/arm-tune.md
index 26c2e1f..ac85f94 100644
--- a/gcc/config/arm/arm-tune.md
+++ b/gcc/config/arm/arm-tune.md
@@ -1,5 +1,5 @@
 ;; -*- buffer-read-only: t -*-
 ;; Generated automatically by gentune.sh from arm-cores.def
 (define_attr "tune"
-	"arm2,arm250,arm3,arm6,arm60,arm600,arm610,arm620,arm7,arm7d,arm7di,arm70,arm700,arm700i,arm710,arm720,arm710c,arm7100,arm7500,arm7500fe,arm7m,arm7dm,arm7dmi,arm8,arm810,strongarm,strongarm110,strongarm1100,strongarm1110,fa526,fa626,arm7tdmi,arm7tdmis,arm710t,arm720t,arm740t,arm9,arm9tdmi,arm920,arm920t,arm922t,arm940t,ep9312,arm10tdmi,arm1020t,arm9e,arm946es,arm966es,arm968es,arm10e,arm1020e,arm1022e,xscale,iwmmxt,iwmmxt2,fa606te,fa626te,fmp626,fa726te,arm926ejs,arm1026ejs,arm1136js,arm1136jfs,arm1176jzs,arm1176jzfs,mpcorenovfp,mpcore,arm1156t2s,arm1156t2fs,genericv7a,cortexa5,cortexa7,cortexa8,cortexa9,cortexa15,cortexr4,cortexr4f,cortexr5,cortexm4,cortexm3,cortexm1,cortexm0,cortexm0plus,marvell_pj4"
+	"arm2,arm250,arm3,arm6,arm60,arm600,arm610,arm620,arm7,arm7d,arm7di,arm70,arm700,arm700i,arm710,arm720,arm710c,arm7100,arm7500,arm7500fe,arm7m,arm7dm,arm7dmi,arm8,arm810,strongarm,strongarm110,strongarm1100,strongarm1110,fa526,fa626,arm7tdmi,arm7tdmis,arm710t,arm720t,arm740t,arm9,arm9tdmi,arm920,arm920t,arm922t,arm940t,ep9312,arm10tdmi,arm1020t,arm9e,arm946es,arm966es,arm968es,arm10e,arm1020e,arm1022e,xscale,iwmmxt,iwmmxt2,fa606te,fa626te,fmp626,fa726te,arm926ejs,arm1026ejs,arm1136js,arm1136jfs,arm1176jzs,arm1176jzfs,mpcorenovfp,mpcore,arm1156t2s,arm1156t2fs,genericv7a,cortexa5,cortexa7,cortexa8,cortexa9,cortexa15,cortexr4,cortexr4f,cortexr5,cortexr7,cortexm4,cortexm3,cortexm1,cortexm0,cortexm0plus,marvell_pj4"
 	(const (symbol_ref "((enum attr_tune) arm_tune)")))
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index e9fe4ef..177ed70 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -11260,7 +11260,7 @@ assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
 @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8}, @samp{cortex-a9}, 
 @samp{cortex-a15}, @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-r5},
-@samp{cortex-m4}, @samp{cortex-m3},
+@samp{cortex-r7}, @samp{cortex-m4}, @samp{cortex-m3},
 @samp{cortex-m1},
 @samp{cortex-m0},
 @samp{cortex-m0plus},

RE: [PATCH] Fix PR50293 - LTO plugin with space in path

2013-02-24 Thread Joey Ye
Ping

> -Original Message-
> From: Joey Ye [mailto:joey...@arm.com]
> Sent: Monday, February 18, 2013 11:32
> To: 'Joseph Myers'
> Cc: gcc-patches@gcc.gnu.org
> Subject: RE: [PATCH] Fix PR50293 - LTO plugin with space in path
> 
> Joseph, Thanks for your valuable comments. See my reply and new patch
> below.
> 
> > -Original Message-
> > From: Joseph Myers [mailto:jos...@codesourcery.com]
> > Sent: Monday, February 18, 2013 06:16
> > To: Joey Ye
> > Cc: gcc-patches@gcc.gnu.org
> > Subject: Re: [PATCH] Fix PR50293 - LTO plugin with space in path
> >
> > On Sun, 17 Feb 2013, Joey Ye wrote:
> >
> > > +static char * convert_white_space(char * orig);
> >
> > Please fix formatting in many places in this patch to follow the GNU
> > Coding Standards.  No space after '*', but space before '('; there
> seem
> > to
> > be various other formatting problems as well.
> My bad. All fixed.
> 
> >
> > > +/* Insert back slash before spaces in a string, to avoid path
> > > +   that has space in it broken into multiple arguments.  */
> >
> > That doesn't seem to be a proper specification of the interface to
> this
> > function.  What are the semantics of ORIG?  A string that is a
> filename,
> > or something else?  What are the exact semantics of the return value
> for
> > quoting - is it correct for the function to convert a (backslash,
> space)
> > pair to (backslash, backslash, space) or not?  Is anything special in
> > the
> > return value other than backslash and space, and how are any special
> > characters in the return value to be interpreted?
> >
> > As it seems like this function frees the argument (why?) this also
> needs
> > to be specified in the comment as part of the semantics of the
> function.
> This function might need a string longer than original one to
> accommodate
> additional back slashes. So it has to xmalloc a new string. The original
> string should be freed in such a case. However, it is tedious to caller
> to figure out that conversion does happens and free the orig. The
> solution
> is for this function to free it when conversion happens.
> 
> By doing so it is required that orig must be allocated and can be freed,
> as the newly added comments described explicitly.
> >
> > It would be a good idea for you to give a more detailed explanation in
> > the
> > next version of the patch submission of how the path, before the patch,
> > got processed so that the spaces were wrongly interpreted.  That might
> > help make clearer whether the interface to this new function is
> actually
> > correct, since the subsequent operations on the return value should
> act
> > as
> > an inverse to the operation carried out by this function.
> >
> > --
> > Joseph S. Myers
> > jos...@codesourcery.com
> 
> Index: gcc/gcc.c
> ===
> --- gcc/gcc.c (revision 195189)
> +++ gcc/gcc.c (working copy)
> @@ -265,6 +265,7 @@
>  static const char *compare_debug_auxbase_opt_spec_function (int, const
> char **);
>  static const char *pass_through_libs_spec_func (int, const char **);
>  static const char *replace_extension_spec_func (int, const char **);
> +static char * convert_white_space (char *);
> 
> 
>  /* The Specs Language
> 
> @@ -6595,6 +6596,7 @@
>   X_OK, false);
>if (lto_wrapper_file)
>  {
> +  lto_wrapper_file = convert_white_space (lto_wrapper_file);
>lto_wrapper_spec = lto_wrapper_file;
>obstack_init (&collect_obstack);
>obstack_grow (&collect_obstack, "COLLECT_LTO_WRAPPER=",
> @@ -7005,12 +7007,13 @@
> + strlen (fuse_linker_plugin), 0))
>  #endif
>   {
> -   linker_plugin_file_spec = find_a_file (&exec_prefixes,
> +   char * temp_spec = find_a_file (&exec_prefixes,
>LTOPLUGINSONAME, R_OK,
>false);
> -   if (!linker_plugin_file_spec)
> +   if (!temp_spec)
>   fatal_error ("-fuse-linker-plugin, but %s not found",
>LTOPLUGINSONAME);
> +   linker_plugin_file_spec = convert_white_space (temp_spec);
>   }
>  #endif
> lto_gcc_spec = argv[0];
> @@ -8506,3 +8509,52 @@
>free (name);
>return result;
>  }
> +
> +/* Insert back slash before spaces in orig (usually a file path), to
> +   avoid being broken by spec parser.
> +
> +   This function is needed as do_spec_1 treats white space (' ' and
> '\t')
> +   as the end of an argument. But in case of -plugin /usr/gcc
> install/xxx.so,
> +   the filename should be treated as a single argument rather than
> being
> +   broken into multiple. Solution is to insert '\\' before the space in
> a
> +   filename.
> +
> +   This function converts and only converts all occurrance of ' '
> +   to '\\' + ' ' and '\t' to '\\' + '\t'.  For example:
> +   "a b"  -> "a\\ b"
> +   "a  b" -> "a\\ \\ b"
> +   "a\tb"

[Patch, fortran] PR51976 - [F2003] Support deferred-length character components of derived types (allocatable string length)

2013-02-24 Thread Paul Richard Thomas
Dear All,

The attached patch represents progress to date.  It fixes the original
problem in this PR and allows John Reid's version of
iso_varying_string/vocabulary_word_count.f90 to compile and run
correctly.  It even bootstraps and regtests!

However, it doe not fix:
PR51976 comment #6 and PR51550 - allocate with typespec ICEs
PR51976 comment #6 FORALL assignment is messed up and ICEs..
PR47545 the compiler complains about the lack of an initializer for
the hidden character length field.
PR45170 will need going through from one end to the other - there is a
lot of "stuff" here!

Of these, I consider the fix of the PR47545 problem to be a must and
the allocate with typespec desirable.

Cheers

Paul

2013-02-24  Paul Thomas  

PR fortran/51976
* gfortran.h : Add deferred_parameter attribute.
* primary.c (build_actual_constructor): It is not an error if
a missing component has the deferred_parameter attribute;
equally, if one is given a value, it is an error.
* resolve.c (resolve_fl_derived0): Remove error for deferred
character length components.  Add the hidden string length
field to the structure. Give it the deferred_parameter
attribute.
* trans-array.c (duplicate_allocatable): Add a strlen field
which is used as the element size if it is non-null.
(gfc_duplicate_allocatable, gfc_copy_allocatable_data): Pass a
NULL to the new argument in duplicate_allocatable.
(structure_alloc_comps): Set the hidden string length as
appropriate. Use it in calls to duplicate_allocatable.
(gfc_alloc_allocatable_for_assignment): When a deferred length
backend declaration is variable, use that; otherwise use the
string length from the expression evaluation.
* trans-expr.c (gfc_conv_component_ref): If this is a deferred
character length component, the string length should have the
value of the hidden string length field.
(gfc_trans_subcomponent_assign): Set the hidden string length
field for deferred character length components.  Allocate the
necessary memory for the string.
(alloc_scalar_allocatable_for_assignment): Same change as in
gfc_alloc_allocatable_for_assignment above.
* trans-stmt.c (gfc_trans_allocate): Likewise.
* trans-types.c (gfc_get_derived_type): Set the tree type for
a deferred character length component.
* trans.c (gfc_deferred_strlen): New function.
* trans.h : Prototype for the new function.

2013-02-24  Paul Thomas  

PR fortran/51976
* gfortran.dg/deferred_type_component_1.f90 : New test.


submit.diff
Description: Binary data


[C++ PATCH] Fix ICE in build_zero_init_1 (PR c++/56403)

2013-02-24 Thread Jakub Jelinek
Hi!

middle-end or back-end created aggregates don't have CLASS_TYPE_P bit set,
so build_zero_init_1 ICEs e.g. on va_list if it is array of structures.

Fixed by treating all RECORD_TYPE or UNION_TYPE types that way, rather than
just CLASS_TYPE_P ones.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2013-02-24  Jakub Jelinek  

PR c++/56403
* init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
of CLASS_TYPE_P.

* g++.dg/torture/pr56403.C: New test.

--- gcc/cp/init.c.jj2013-02-07 22:27:09.0 +0100
+++ gcc/cp/init.c   2013-02-24 20:07:12.246690837 +0100
@@ -179,7 +179,7 @@ build_zero_init_1 (tree type, tree nelts
 init = convert (type, nullptr_node);
   else if (SCALAR_TYPE_P (type))
 init = convert (type, integer_zero_node);
-  else if (CLASS_TYPE_P (type))
+  else if (RECORD_OR_UNION_CODE_P (TREE_CODE (type)))
 {
   tree field;
   vec *v = NULL;
--- gcc/testsuite/g++.dg/torture/pr56403.C.jj   2013-02-24 20:05:41.961233765 
+0100
+++ gcc/testsuite/g++.dg/torture/pr56403.C  2013-02-24 20:05:14.0 
+0100
@@ -0,0 +1,12 @@
+// PR c++/56403
+// { dg-do compile }
+
+#include 
+
+struct S { va_list err_args; };
+
+void *
+foo ()
+{
+  return new S ();
+}

Jakub


Re: r196201 - in /trunk: gcc/ChangeLog gcc/config/i...

2013-02-24 Thread Jakub Jelinek
On Fri, Feb 22, 2013 at 02:42:44PM -0800, H.J. Lu wrote:
> 2013-02-22  H.J. Lu  
> 
>   * bootstrap-asan.mk (POSTSTAGE1_LDFLAGS): Add
>   -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/asan/.
> diff --git a/config/bootstrap-asan.mk b/config/bootstrap-asan.mk
> index d37a9da..e3f34f5 100644
> --- a/config/bootstrap-asan.mk
> +++ b/config/bootstrap-asan.mk
> @@ -3,4 +3,5 @@
>  STAGE2_CFLAGS += -fsanitize=address
>  STAGE3_CFLAGS += -fsanitize=address
>  POSTSTAGE1_LDFLAGS += -fsanitize=address -static-libasan \
> +   -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/asan/ \
> -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/asan/.libs

Ok.

Jakub


Re: RFC: [PATCH,ARM] Fix 56110

2013-02-24 Thread Tilman Sauerbeck
Richard Earnshaw [2013-02-20 11:00]:
> On 19/02/13 22:26, Tilman Sauerbeck wrote:
> >I don't get why relaxing the restrictions for the
> >andsi3_compare0_scratch pattern results in a mismatch for the
> >zeroextractsi_compare0_scratch one.
> >
> >Any ideas?
> 
> Because of the way combine works.  It first tries to find a pattern that
> doesn't have a clobber expression.  It finds your new pattern and then uses
> that.  But since that can't handle immediates, reload then comes along and
> forces the constant into a register.
> 
> You need one pattern to deal with all the cases.

You mean the pattern should include calls to arm_split_constant() to do
the loading itself, like e.g. the iorsi3 pattern does?
Why can't we let reload do the load?

FWIW the patch in http://gcc.gnu.org/ml/gcc-patches/2013-02/msg00920.html
works for my testcases, survives a bootstrap in qemu and passes the
test suite (I only built/tested the C and C++ frontends though).

Thanks,
Tilman

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?


Re: [PATCH] PR55033: Fix

2013-02-24 Thread Dave Korn
On 12/02/2013 16:11, Sebastian Huber wrote:
> This patch from Alan Modra fixes a section type conflict error.  See also
> 
> http://gcc.gnu.org/ml/gcc-patches/2012-10/msg02172.html

  The Windows part is OK.  I ran the g++ testsuite (gcc/, not libstdc) with no
change before and after.

cheers,
  DaveK



Re: Ping: [Patch,avr]: Add more devices take #2: 2/2

2013-02-24 Thread Denis Chertykov
2013/2/19 Georg-Johann Lay :
> CCing Richard in case this needs RM approval (I don't think so because the
> patch just changes ternary parts).
>
> Ping #1 for:
> http://gcc.gnu.org/ml/gcc-patches/2013-02/msg00579.html
>
>
> Georg-Johann Lay schrieb:
>>
>> And here 2/2 with the device -> arch mapping for gas.
>>
>>
>> Ok for trunk?
>>
>> Johann
>>
>>
>> * config/avr/avr.h (device_to_arch): Rename to device_to_ld.
>> (avr_device_to_arch): Rename to avr_device_to_ld.
>> (avr_device_to_as): New prototype.
>> (EXTRA_SPEC_FUNCTIONS): Add device_to_as.
>> (ASM_SPEC): Use device_to_as to get -mmcu= and -mno-skip-bug=.
>> * config/avr/driver-avr.c (avr_device_to_as): New.
>> (avr_device_to_arch): Rename to avr_device_to_ld.
>>
>

I'm sorry. I was on vacation.

Approved.

Denis.