Re: Re: patch: don't issue -Wreorder warnings when order doesn't matter

2011-07-31 Thread Daniel Marjamäki
>
> If the initializer is constant, but the member value that's being
> initialized has a
> non-trivial constructor with a side effect, your patch will inhibit the 
> warning
> but the program will not behave the same as if reordering had not happened.
>
> Peter
>

Yes. It sounds unlikely. But not impossible of course. I could also
make sure the member variables are POD types before I inhibit the
warning. I just have no idea how I check if a member is POD. But I
could investigate this.
I think, this will still remove most of the -Wreorder warnings that I get.

Best regards,
Daniel


Re: Re: patch: don't issue -Wreorder warnings when order doesn't matter

2011-07-31 Thread Joern Rennecke

Quoting Daniel Marjamäki :


Yes. It sounds unlikely. But not impossible of course. I could also
make sure the member variables are POD types before I inhibit the
warning. I just have no idea how I check if a member is POD. But I
could investigate this.


You could check if it has a constructor, using
TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (field))


Re: PATCH RFA: Build stages 2 and 3 with C++

2011-07-31 Thread Marc Glisse

On Fri, 15 Jul 2011, Ian Lance Taylor wrote:


I would like to propose this patch as a step toward building gcc using a
C++ compiler.  This patch builds stage1 with the C compiler as usual,
and defaults to building stages 2 and 3 with a C++ compiler built during
stage 1.  This means that the gcc installed and used by most people will
be built by a C++ compiler.  This will ensure that gcc is fully
buildable with C++, while retaining the ability to bootstrap with only a
C compiler, not a C++ compiler.


Nice step. Now that gcc can (mostly) build with g++, it would be great if 
it could build with a non-gnu compiler. More precisely, with a compiler 
that doesn't define __GNUC__. Indeed, the code is quite different in this 
case, as can be seen trying to compile gcc with CC='gcc -U__GNUC__' and 
CXX='g++ -U__GNUC__' (there are other reasons why this won't work, but at 
least it shows some of the same issues I see with sunpro).



To start with, the obstack_free macro casts a pointer to an int -> error.
/data/repos/gcc/trunk/libcpp/directives.c:2048:7: error: cast from ‘char*’ 
to ‘int’ loses precision [-fpermissive]



Then, ENUM_BITFIELD(cpp_ttype) is expanded to unsigned int instead of the 
enum, and conversions from int to enum require an explicit cast in C++, 
giving many errors like:
/data/repos/gcc/trunk/libcpp/charset.c:1615:79: error: invalid conversion 
from ‘unsigned int’ to ‘cpp_ttype’ [-fpermissive]
/data/repos/gcc/trunk/libcpp/charset.c:1371:1: error:   initializing 
argument 5 of ‘bool cpp_interpret_string(cpp_reader*, const cpp_string*, 
size_t, cpp_string*, cpp_ttype)’ [-fpermissive]


Do we want to add a cast in almost every place a field declared with 
ENUM_BITFIELD is used? That's quite a lot of places, everywhere in gcc...
The alternative would be to store the full enum instead of a bitfield 
(just for stage1 so that's not too bad), but some comments in the code 
seem to advise against it.


--
Marc Glisse


Re: onlinedocs formated text too small to read

2011-07-31 Thread Jon Grant

Hello

Georg-Johann Lay wrote, On 08/07/11 19:08:
[.]

I can confirm that it's hardly readable on some systems.
I use Opera and several FF versions, some worse, some a bit less worse.

IMO it's definitely to small, I already thought about complaining, too.

Johann


Could I ask, what would be the best way to progress this request? e.g. 
Should I create a bugzilla ticket.


Best regards, Jon


RE: [RFC] Add middle end hook for stack red zone size

2011-07-31 Thread Jiangning Liu
Joern,

Thanks for your valuable feedback! This is only a RFC, and I will send out 
formal patch along with ChangLog later on. 

Basically, my patch is only to add new dependence in scheduler, and it only 
blocks some instruction movements, so it is NO RISK to compiler correctness. 
For whatever stack pointer changes you gave in different scenarios, the current 
code base should already work. My patch intends neither to replace old 
dependences, nor maximize the scheduler capability due to the existence of red 
zone in stack. It is only to block the memory access moving over stack pointer 
adjustment if distance is beyond red zone size, which is an OS requirement due 
to interruption existence. 

Stack adjustment in epilogue is a very general usage in stack frame. It's quite 
necessary to solve the general problem in middle-end rather than in back-end. 
Also, that old patch you attached is to solve the data dependence between two 
memory accesses, but stack pointer doesn't really have data dependence with 
memory access without using stack pointer, so they have different stories. 
Alternative solution of without adding blunt scheduling barrier is we insert an 
independent pass before scheduler to create RTL barrier by using the same 
interface stack_red_zone_size, but it would really be an over-design, if we add 
a new pass only for this *small* functionality.

In my patch, *abs* of offset is being used, so you are right that it's possible 
to get false positive to be too conservative, but there won't exist false 
negative, because my code would only add new dependences. 

Since the compilation is based on function, it would be OK if red zone size 
varies due to different ABI. Could you please tell me exactly on what system 
being supported by GCC red zone size can be different for incoming and 
outgoing? And also how scheduler guarantee the correctness in current code 
base? Anyway, I don't think my patch will break the original solution.

Thanks,
-Jiangning

> -Original Message-
> From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches-ow...@gcc.gnu.org]
> On Behalf Of Joern Rennecke
> Sent: Tuesday, July 26, 2011 10:33 AM
> To: Jiangning Liu
> Cc: gcc@gcc.gnu.org; gcc-patc...@gcc.gnu.org; vmaka...@redhat.com;
> dje@gmail.com; Richard Henderson; Ramana Radhakrishnan; 'Ramana
> Radhakrishnan'
> Subject: RE: [RFC] Add middle end hook for stack red zone size
> 
> Quoting Jiangning Liu :
> 
> > Hi,
> >
> > One month ago, I sent out this RFC to *gcc-patches* mail list, but I
> >  didn't receive any response yet. So I'm forwarding this mail to
> > *gcc* mail list. Can anybody here really give feedback to me?
> 
> Well, I couldn't approve any patch, but I can point out some issues with your 
> patch.
> 
> First, it's missing a ChangeLog, and you don't state how you have tested it.
> And regarding the code in sched_analyze_1, I think you'll get false positives 
> with
> alloca, and false negatives when registers are involved to compute offsets or 
> to
> restore the stack pointer from.
> 
> FWIW, I think generally blunt scheduling barriers should be avoided, and 
> instead
> the dependencies made visible to the scheduler.
> E.g., I've been working with another architecture with a redzone, where at 
> -fno-
> omit-frame-pointer, the prologue can put pretend_args into the redzone, then 
> after
> stack adjustment and frame allocation, these arguments are accessed via the 
> frame
> pointer.
> 
> With the attached patchlet, alias analysis works for this situation too, so 
> no blunt
> scheduling block is required.
> 
> Likewise, with stack adjustments, they should not affect scheduling in 
> general, but
> be considered to clobber the part of the frame that is being exposed to 
> interrupt
> writes either before or after the adjustment.
> At the moment, each port that wants to have such selective scheduling 
> blockages
> has to define a stack_adjust pattern with a memory clobber in a parallel, 
> with a
> memref that shows the high water mark of possible interrupt stack writes.
> Prima facia it would seem convenient if you only had to tell the middle-end 
> about
> the redzone size, and it could figure out the implicit clobbers when the 
> stack is
> changed.  However, when a big stack adjustment is being made, or the stack is
> realigned, or restored from the frame pointer / another register where it was
> saved due to realignment, the adjustment is not so obvious.  I'm not sure if 
> you can
> actually create an robust interface that's simpler to use than putting the 
> right
> memory clobber in the stack adjust pattern.  Note also that the redzone size 
> can
> vary from function to function depending on ABI-altering attributes, in 
> particular
> for interrupt functions, which can also have different incoming and outgoing
> redzone sizes.  Plus, you can have an NMI / reset handler which can use the 
> stack
> like an ordinary address register.





Help with PPC Relocation options

2011-07-31 Thread Rohit Arul Raj
Hello All,

I compiled a simple 1.c file with -mpcu=e500mc64 option and while
trying to create a relocatable, i am getting the following error:

$powerpc-elf-ld.exe -static -r 1.o
powerpc-elf-ld.exe: Relocatable linking with relocations from format
elf64-powerpc (1.o) to format elf32-powerpc (a.out) is not supported


$ powerpc-elf-ld.exe -static -r 1.o --oformat elf64-powerpc
powerpc-elf-ld.exe: Relocatable linking with relocations from format
elf64-powerpc (1.o) to format elf64-powerpc (a.out) is not supported

Is relocatable linking not allowed for 64bit PPC?

Regards,
Rohit