Re: extern const (Was: Re: [gcc-in-cxx]: patches from multi-target-4_4-branch)

2009-05-24 Thread Ian Lance Taylor
Joern Rennecke writes: > Quoting Ian Lance Taylor : > >> Joern Rennecke writes: >>> ... Could we use a #define >>> for this? E.g. put in system.h >>> #ifdef __cplusplus >>> #define CONST_VAR_DECL extern const >>> #else >>> #define CONST_VAR_DECL const >>> #endif >> >> Yes, that is certainly t

Re: extern const (Was: Re: [gcc-in-cxx]: patches from multi-target-4_4-branch)

2009-05-24 Thread Joern Rennecke
Quoting Ian Lance Taylor : Joern Rennecke writes: ... Could we use a #define for this? E.g. put in system.h #ifdef __cplusplus #define CONST_VAR_DECL extern const #else #define CONST_VAR_DECL const #endif Yes, that is certainly the way to go if it is in fact not safe to use "extern const

Re: extern const (Was: Re: [gcc-in-cxx]: patches from multi-target-4_4-branch)

2009-05-24 Thread Ian Lance Taylor
Joern Rennecke writes: > Quoting Ian Lance Taylor : >> Joern Rennecke writes: >>> * config/sh/sh.c (sh_attribute_table): Use extern in forward >>> declaration. >>> Common issue with declaring/defining const variables in C++. >> >> I've been doing this as >> >> #ifdef __cplusplus >> exter

extern const (Was: Re: [gcc-in-cxx]: patches from multi-target-4_4-branch)

2009-05-24 Thread Joern Rennecke
Quoting Ian Lance Taylor : Joern Rennecke writes: * config/sh/sh.c (sh_attribute_table): Use extern in forward declaration. Common issue with declaring/defining const variables in C++. I've been doing this as #ifdef __cplusplus extern #endif These #ifdefs sprinkled over the

Re: Limiting the use of pointer registers

2009-05-24 Thread Michael Meissner
On Sun, May 24, 2009 at 10:23:05PM +1200, Michael Hope wrote: > Hi there. I'm working on a port to an architecture where the pointer > registers X and Y are directly backed by small 128 byte caches. > Changing one of these registers to a different memory row causes a > cache load cycle, so using t

Re: Limiting the use of pointer registers

2009-05-24 Thread Ian Lance Taylor
Michael Hope writes: > How can I prevent the register allocator from using these for anything > but memory access? Unfortunately, you can't. You can make them the last registers the allocator will use, but if you say that they can hold Pmode values then the register allocator will use them. >

gcc-4.3-20090524 is now available

2009-05-24 Thread gccadmin
Snapshot gcc-4.3-20090524 is now available on ftp://gcc.gnu.org/pub/gcc/snapshots/4.3-20090524/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 4.3 SVN branch with the following options: svn://gcc.gnu.org/svn/gcc/branches

Re: Seeking suggestion

2009-05-24 Thread Michael Meissner
On Fri, May 22, 2009 at 05:04:22PM -0700, Jamie Prescott wrote: > > > From: Jamie Prescott > > To: gcc@gcc.gnu.org > > Sent: Friday, May 22, 2009 10:36:47 AM > > Subject: Seeking suggestion > > > > > > Suppose you're writing the backend for a VM supporting two architectures, > > in > > which

Re: [RFC] removing statement walking from domwalk.c?

2009-05-24 Thread Richard Guenther
On Sun, May 24, 2009 at 7:09 PM, Paolo Bonzini wrote: > Hi all, > > for my next patch to fwprop for PR33928, I need a dominator walk and I > would have liked to use domwalk.c; however it is only for trees at the > moment, while I need it on RTL. > > I was thinking therefore of removing the followi

[RFC] removing statement walking from domwalk.c?

2009-05-24 Thread Paolo Bonzini
Hi all, for my next patch to fwprop for PR33928, I need a dominator walk and I would have liked to use domwalk.c; however it is only for trees at the moment, while I need it on RTL. I was thinking therefore of removing the following fields from the dominator walk callbacks: BOOL_BITFIELD walk_

Re: What does zero-length array mean at file scope?

2009-05-24 Thread Dave Korn
Andrew Haley wrote: >>> Obviously I can't see for looking; can you please point me to the precise >>> chapter/page/paragraph/line that I should have found earlier? > > "Zero-length arrays are allowed in GNU C. They are very useful as the > last element of a structure ..." > > That doesn't in

Re: What does zero-length array mean at file scope?

2009-05-24 Thread Andrew Haley
Dave Korn wrote: > Dave Korn wrote: >> Dave Korn wrote: >>> I've read http://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html about six >>> times and can't see anywhere it even hints that you can use this syntax >>> anywhere except as the trailing member of a struct. >> Andrew Haley wrote: >>> But zero-

Re: problem with getting statements (DECL_SAVED_TREE?)

2009-05-24 Thread Richard Guenther
On Sun, May 24, 2009 at 2:29 PM, Brad Hards wrote: > On Sunday 24 May 2009 10:03:36 pm Richard Guenther wrote: >> On Sun, May 24, 2009 at 1:38 PM, Brad Hards wrote: >> > Essentially, the problem appears to be that DECL_SAVED_TREE() returns >> > null. If I understand the treehydra code, that used

Re: problem with getting statements (DECL_SAVED_TREE?)

2009-05-24 Thread Brad Hards
On Sunday 24 May 2009 10:03:36 pm Richard Guenther wrote: > On Sun, May 24, 2009 at 1:38 PM, Brad Hards wrote: > > Essentially, the problem appears to be that DECL_SAVED_TREE() returns > > null. If I understand the treehydra code, that used to provide a list of > > GENERIC instructions. Is there a

Re: problem with getting statements (DECL_SAVED_TREE?)

2009-05-24 Thread Richard Guenther
On Sun, May 24, 2009 at 1:38 PM, Brad Hards wrote: > Hi, > > I'm trying to help with the porting of dehydra / treehydra to gcc 4.5. > > There are some tests that are failing, and in working through them, I'm > finding some issues that might be differences between 4.3 and 4.5. > > One problem is ab

problem with getting statements (DECL_SAVED_TREE?)

2009-05-24 Thread Brad Hards
Hi, I'm trying to help with the porting of dehydra / treehydra to gcc 4.5. There are some tests that are failing, and in working through them, I'm finding some issues that might be differences between 4.3 and 4.5. One problem is about walking the instructions associated with a function. The tr

Re: What does zero-length array mean at file scope?

2009-05-24 Thread Dave Korn
Dave Korn wrote: > Dave Korn wrote: >> I've read http://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html about six >> times and can't see anywhere it even hints that you can use this syntax >> anywhere except as the trailing member of a struct. > > Andrew Haley wrote: >> But zero-length arrays are a gc

Re: What does zero-length array mean at file scope?

2009-05-24 Thread Dave Korn
Dave Korn wrote: > I've read http://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html about six > times and can't see anywhere it even hints that you can use this syntax > anywhere except as the trailing member of a struct. Andrew Haley wrote: > But zero-length arrays are a gcc extension. There's nothi

Re: What does zero-length array mean at file scope?

2009-05-24 Thread Andrew Haley
Dave Korn wrote: > Andrew Haley wrote: >> Dave Korn wrote: >>> Dave Korn wrote: Dave Korn wrote: > ELF GAS/LD seem happy enough when presented with a ".comm foo,0" > directive, but PE does rather literally what you asked, and gives you > no data object, leading to i0 in the ab

Limiting the use of pointer registers

2009-05-24 Thread Michael Hope
Hi there. I'm working on a port to an architecture where the pointer registers X and Y are directly backed by small 128 byte caches. Changing one of these registers to a different memory row causes a cache load cycle, so using them for memory access is fine but using them as general purpose regist

Re: a strange make error

2009-05-24 Thread Dave Korn
william xiao wrote: > I' m trying to make some changes to GCC4.2. I want to obtain some > information about callee so i add one statment to function: rtx > expand_call (tree exp, rtx target, int ignore) as follows: > > 2702 /* Generate the actual call instruction. */ > 2703 emit_call_1

Re: What does zero-length array mean at file scope?

2009-05-24 Thread Dave Korn
Andrew Haley wrote: > Dave Korn wrote: >> Dave Korn wrote: >>> Dave Korn wrote: >>> ELF GAS/LD seem happy enough when presented with a ".comm foo,0" directive, but PE does rather literally what you asked, and gives you no data object, leading to i0 in the above being an undefined >>

Re: What does zero-length array mean at file scope?

2009-05-24 Thread Andrew Haley
Dave Korn wrote: > Dave Korn wrote: >> Dave Korn wrote: >> >>> ELF GAS/LD seem happy enough when presented with a ".comm foo,0" >>> directive, >>> but PE does rather literally what you asked, and gives you no data object, >>> leading to i0 in the above being an undefined reference at link time.

Re: Seeking suggestion

2009-05-24 Thread Georg-Johann Lay
Jamie Prescott schrieb: Is there a reason why something like this would not work? (define_insn "addsi3_nc" [(set (match_operand:SI 0 "fullreg_operand" "=r") (plus:SI (match_operand:SI 1 "fullreg_operand" "r") (match_operand:SI 2 "fullreg_or_imm_operand" "rn")))] ""

a strange make error

2009-05-24 Thread william xiao
I' m trying to make some changes to GCC4.2. I want to obtain some information about callee so i add one statment to function: rtx expand_call (tree exp, rtx target, int ignore) as follows: 2702  /* Generate the actual call instruction.  */ 2703  emit_call_1 (funexp, exp, fndecl, funtype, u

Re: What does zero-length array mean at file scope?

2009-05-24 Thread Uros Bizjak
Hello! I found something rather odd in testcase gcc.c-torture/execute/20030811-1.c: > /* Origin: PR target/11535 from H. J. Lu */ > > void vararg (int i, ...) > { > (void) i; > } > > int i0[0], i1; Huh? > void test1 (void) > { > int a = (int) (long long) __builtin_return_address