global/df dropping a needed set?

2008-10-30 Thread DJ Delorie

For m32c-elf with gcc.c-torture/execute/980707-1.c, global seems to be
deleting a set that's needed to set the exit code - i.e. it's the
first argument to exit().  There's also this suspicious message in the
global dump:

changing reg in insn 95

I can't tell if they're changing the pseudo (ok) or $r0 (not ok).

Target: m32c-elf

command line:
./cc1 -fpreprocessed 980707-1.i -quiet -dumpbase 980707-1.c -dap -msim 
-mcpu=m32c -auxbase 980707-1 -g -O3 -w -version -fomit-frame-pointer 
-fno-show-column -fdump-tree-all -o 980707-1.s

After local, the rtl looks like this:

;; Start of basic block ( 15) -> 17
;; bb 17 artificial_defs: { }
;; bb 17 artificial_uses: { u98(7){ }u99(8){ }u100(11){ }}
;; lr  in7 [fb] 8 [sp] 11 [argp] 29
;; lr  use   7 [fb] 8 [sp] 11 [argp] 29
;; lr  def   0 [r0] 6 [sb] 9 [pc] 10 [flg] 12 [mem0] 13 [mem2] 14 [mem4] 15 
[mem6] 16 [mem8] 17 [mem10] 18 [mem12] 19 [mem14]
;; live  in  7 [fb] 8 [sp] 11 [argp] 29
;; live  gen 0 [r0]
;; live  kill   

;; Pred edge  15 [0.0%] 
(code_label 92 91 93 17 23 "" [1 uses])

(note 93 92 94 17 [bb 17] NOTE_INSN_BASIC_BLOCK)

(note 94 93 95 17 NOTE_INSN_DELETED)

(insn 95 94 96 17 980707-1.i:585 (set (reg:HI 0 r0)
(reg:HI 29 [ D.1908 ])) 171 {movhi_op} (expr_list:REG_DEAD (reg:HI 29 [ 
D.1908 ])
(expr_list:REG_EQUAL (const_int 0 [0x0])
(nil

(call_insn 96 95 97 17 980707-1.i:585 (parallel [
(call (mem:QI (symbol_ref:PSI ("exit") [flags 0x41] ) [0 S1 A8])
(const_int 0 [0x0]))
(use (const_int 0 [0x0]))
]) 164 {call} (expr_list:REG_DEAD (reg:HI 0 r0)
(expr_list:REG_EH_REGION (const_int 0 [0x0])
(expr_list:REG_NORETURN (const_int 0 [0x0])
(nil
(expr_list:REG_DEP_TRUE (use (reg:HI 0 r0))
(nil)))
;; End of basic block 17 -> ()
;; lr  out   7 [fb] 8 [sp] 11 [argp]
;; live  out 7 [fb] 8 [sp] 11 [argp]


After global, it's this:

;; Start of basic block ( 15) -> 17
;; bb 17 artificial_defs: { }
;; bb 17 artificial_uses: { u-1(7){ }u-1(8){ }}
;; lr  in0 [r0] 7 [fb] 8 [sp]
;; lr  use   0 [r0] 7 [fb] 8 [sp]
;; lr  def   0 [r0] 6 [sb] 9 [pc] 10 [flg] 12 [mem0] 13 [mem2] 14 [mem4] 15 
[mem6] 16 [mem8] 17 [mem10] 18 [mem12] 19 [mem14]
;; live  in  0 [r0] 7 [fb] 8 [sp]
;; live  gen
;; live  kill   

;; Pred edge  15 [0.0%] 
(code_label 92 91 93 17 23 "" [1 uses])

(note 93 92 94 17 [bb 17] NOTE_INSN_BASIC_BLOCK)

(note 94 93 96 17 NOTE_INSN_DELETED)

(call_insn 96 94 97 17 980707-1.i:585 (parallel [
(call (mem:QI (symbol_ref:PSI ("exit") [flags 0x41] ) [0 S1 A8])
(const_int 0 [0x0]))
(use (const_int 0 [0x0]))
]) 164 {call} (expr_list:REG_EH_REGION (const_int 0 [0x0])
(expr_list:REG_NORETURN (const_int 0 [0x0])
(nil)))
(expr_list:REG_DEP_TRUE (use (reg:HI 0 r0))
(nil)))
;; End of basic block 17 -> ()
;; lr  out   8 [sp]
;; live  out 8 [sp]


Note that the call has the (use) for r0, the argument register.
Inspection of the .s file shows that r0 is provably NOT zero (it's
last used as an array index), causing many test cases to appear to
fail.

I can't seem to find why it's doing this, but the code that does the
actual deletion is in df-scan.c.

Ideas?


Account request

2008-10-30 Thread Dennis Wassel
Hi,

I am currently having my first patch to gfortran accepted, but was not
able to manipulate the PR in bugzilla. A helpful soul on the gfortran
list then pointed me to this address to ask whether I need a
gcc.gnu.org account to work with bugzilla. Is that right? If it is,
where can I get one of those? If this is already the right place,
[EMAIL PROTECTED] would be my choice :)

Thanks!
Dennis


Re: Including free compiler in a comercial software

2008-10-30 Thread MICHAEL R. MEISSNER
On Thu, 2008-10-30 at 20:15 -0400, Robert Dewar wrote:
> Michael Meissner wrote:
> 
> > If you are including GCC in your program, your program needs to be licensed
> > such to allow this (typically gplv3).  If you are just providing the 
> > compiler
> > as a separate package without modifications, then this is a much simpler 
> > matter
> > (this is allowed under section 4 of the gplv3).  You really would need to 
> > talk
> > to a lawyer to get an understanding of the rules and regulations for 
> > anything
> > complicated (hint, most of the people reading this mailing list are not
> > lawyers).
> 
> That's fair advice, but if all you want to do is to include a standard
> version of gcc with sources as part of your package, that does not count
> as complicated, and all you have to do is to include the file COPYING3
> with a note that it refers to the included gcc compiler.

Yes, for verbatim copies, you can include the sources in toto.  Quoting
from the gplv3:

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

My point was if you've modified the compiler sources in any way, then
you must follow section 5:
  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.

b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7.  This requirement modifies the requirement in section 4 to
"keep intact all notices".

c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy.  This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged.  This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.

d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

And if you provide binaries, then section 6 applies.




Re: Including free compiler in a comercial software

2008-10-30 Thread Robert Dewar

Michael Meissner wrote:


If you are including GCC in your program, your program needs to be licensed
such to allow this (typically gplv3).  If you are just providing the compiler
as a separate package without modifications, then this is a much simpler matter
(this is allowed under section 4 of the gplv3).  You really would need to talk
to a lawyer to get an understanding of the rules and regulations for anything
complicated (hint, most of the people reading this mailing list are not
lawyers).


That's fair advice, but if all you want to do is to include a standard
version of gcc with sources as part of your package, that does not count
as complicated, and all you have to do is to include the file COPYING3
with a note that it refers to the included gcc compiler.



Re: Including free compiler in a comercial software

2008-10-30 Thread Michael Meissner
On Thu, Oct 30, 2008 at 06:09:28PM -0400, Robert Dewar wrote:
> Cristian Harja wrote:
> >Hello,
> >
> >I'm a young developer, with very strong knowledge about programming, 
> >especially C++. I am working to one of my greatest projects. I'm building 
> >up a framework that can create native Win32 applications, console 
> >applications, and provides intelligent and efficient classes to manage 
> >different types of data.
> >
> >Since this framework is a set of classes, templates and functions, I need 
> >a compiler to "bring it to life". I want to create my own programming 
> >environment,including a class browser (for the framework), a header 
> >manager (to include / exclude components), and detailed documentation. I 
> >want to SELL this software, so there's going to be a problem. I can't make 
> >my own compiler, and free compilers, usually should not be comercialized.
> 
> There is absolutely nothing to stop you selling a package that contains 
> GPL'ed software, lots of companies do this. The idea that "free 
> [software] compilers should not be commercialized" is misguided.
> If it makes sense to sell a package that includes gcc or other
> such components, you are free to do so. Of course you will have
> to include the sources of the compiler, but that's no big deal.
> It makes perfect sense to sell a package like this, of course
> we would prefer to see you sell your framework as Free Software
> as well, and encourage you to consider this possibility. Remember
> the Free in Free Software is about non-restrictive user-friendly
> licensing, not about free in dollars!

Note, it is somewhat more complicated than just include the source files.  See
the file COPYING3 for the rules and regulations for current compiler sources
(GNU public license version 3, or gplv3), and COPYING for the rules and
regulations for 4.1 or earlier releases (GNU public license version 2, or
gplv2).  For example, you must not restrict the rights of people who get the
compiler from you, and your changes to the compiler itself must be compatible
with the appropriate gpl.


> >I want an advice, or an approvement to include GCC in my program (of 
> >course, mentioning it). I would also like to know if there are several 
> >compilers that can be "comercialized" this way. I do not intend to sell 
> >any free compiler. I am not going to provide any source code from my 
> >framework (only ".lib" and ".h"). I can't provide just the headers and a 
> >lib, or something, because I don't know what differences may exist between 
> >the compilers.
> >
> >Please answer me at <[EMAIL PROTECTED]>

If you are including GCC in your program, your program needs to be licensed
such to allow this (typically gplv3).  If you are just providing the compiler
as a separate package without modifications, then this is a much simpler matter
(this is allowed under section 4 of the gplv3).  You really would need to talk
to a lawyer to get an understanding of the rules and regulations for anything
complicated (hint, most of the people reading this mailing list are not
lawyers).

-- 
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
[EMAIL PROTECTED]


gcc-4.3-20081030 is now available

2008-10-30 Thread gccadmin
Snapshot gcc-4.3-20081030 is now available on
  ftp://gcc.gnu.org/pub/gcc/snapshots/4.3-20081030/
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/gcc-4_3-branch 
revision 141467

You'll find:

gcc-4.3-20081030.tar.bz2  Complete GCC (includes all of below)

gcc-core-4.3-20081030.tar.bz2 C front end and core compiler

gcc-ada-4.3-20081030.tar.bz2  Ada front end and runtime

gcc-fortran-4.3-20081030.tar.bz2  Fortran front end and runtime

gcc-g++-4.3-20081030.tar.bz2  C++ front end and runtime

gcc-java-4.3-20081030.tar.bz2 Java front end and runtime

gcc-objc-4.3-20081030.tar.bz2 Objective-C front end and runtime

gcc-testsuite-4.3-20081030.tar.bz2The GCC testsuite

Diffs from 4.3-20081023 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-4.3
link is updated and a message is sent to the gcc list.  Please do not use
a snapshot before it has been announced that way.


Re: Building GCC 4.3.2 on powerpc-yellowdog-linux-gnu

2008-10-30 Thread Ben Elliston
> I'm trying to build (natively) GCC 4.3.2 on a
> powerpc-yellowdog-linux-gnu. I have not yet managed to build it all
> ('make bootstrap') but I found out that each of the following changes
> (applied in the order specified) takes me further on:
> 
> -- insert '#include ' in libcpp/include/line-map.h:26 (to work
> around errors about undefined CHAR_BIT or UINT_MAX);
> -- insert '#include ' in gcc/real.h:29;
> -- add BOOT_CFLAGS='-DENABLE_DECIMAL_FLOAT=1
> -DENABLE_DECIMAL_BID_FORMAT=0' to 'make bootstrap' since these
> macros were not defined (this is stage 2);
> -- insert '#include ' in gcc/hard-reg-set.h:24;
> -- insert '#include ' in gcc/toplev.h:24;
> -- added -DHAVE_LIMITS_H to BOOT_CFLAGS;
> -- added -DHAVE_GAS_SHF_MERGE=0 to BOOT_CFLAGS;

You should not have to make any of these changes to bootstrap GCC 4.3.2
on a PowerPC GNU/Linux system.  We build these compilers regularly and
do not have to do this.

I think you're probably building GCC incorrectly.  Please follow-up with
a list of your steps to [EMAIL PROTECTED]

Thanks, Ben

-- 
Ben Elliston <[EMAIL PROTECTED]>
Australia Development Lab, IBM



Re: Including free compiler in a comercial software

2008-10-30 Thread Robert Dewar

Cristian Harja wrote:

Hello,

I'm a young developer, with very strong knowledge about programming, especially 
C++. I am working to one of my greatest projects. I'm building up a framework 
that can create native Win32 applications, console applications, and provides 
intelligent and efficient classes to manage different types of data.

Since this framework is a set of classes, templates and functions, I need a compiler to 
"bring it to life". I want to create my own programming environment,including a 
class browser (for the framework), a header manager (to include / exclude components), 
and detailed documentation. I want to SELL this software, so there's going to be a 
problem. I can't make my own compiler, and free compilers, usually should not be 
comercialized.


There is absolutely nothing to stop you selling a package that contains 
GPL'ed software, lots of companies do this. The idea that "free 
[software] compilers should not be commercialized" is misguided.

If it makes sense to sell a package that includes gcc or other
such components, you are free to do so. Of course you will have
to include the sources of the compiler, but that's no big deal.
It makes perfect sense to sell a package like this, of course
we would prefer to see you sell your framework as Free Software
as well, and encourage you to consider this possibility. Remember
the Free in Free Software is about non-restrictive user-friendly
licensing, not about free in dollars!


I want an advice, or an approvement to include GCC in my program (of course, mentioning it). I would also 
like to know if there are several compilers that can be "comercialized" this way. I do not intend 
to sell any free compiler. I am not going to provide any source code from my framework (only ".lib" 
and ".h"). I can't provide just the headers and a lib, or something, because I don't know what 
differences may exist between the compilers.

Please answer me at <[EMAIL PROTECTED]>


Chris






'recording' program execution.

2008-10-30 Thread Edward Peschko
All,

dbx has a feature called 'trace' where it outputs your program
execution, a line at a time, and I've found it very useful for
debugging/figuring out programs (you run it once, make a change, run
it again, and do a diff to see exactly how your change affects the
programming run).

However, it is exceedingly slow - as is the analogue in gdb - so I've
written a very ugly hack in perl that basically does the same thing by
instrumenting the source code with macros to print out each step. So:

int main()
{
fprintf(stderr, "HERE");
}

becomes:

int main()
__pl1({)
__pf1(fprintf(stderr, "HERE"););
__pf1(})

where each macro calls a hook to print out the text inside of it,
after mirroring it for the compiler, (ie: the above expands to:):

int main()
{
   fprintf(log, "{\n");
   fprintf(stderr, "HERE");
   fprintf(log, "fprintf(stderr, \"HERE\");\n");
   fprintf(log, "}\n");
}


This works - it is incredibly fast, and you can basically debug any
size application this way - but it is horrendously ugly, doesn't work
seamlessly and requires a lot of elbow grease (macros in particular
are a real pain).

What I'd prefer is a compiler flag that does basically the same thing,
ie: puts hooks in the code such that after each step, a special, user
defined function is called which takes as an argument the relevant
source code that is to be executed (and whether or not a subroutine is
being exited or entered), and lets the user do whatever they want with
it.

Would this be possible to do with changes to gcc? If so, what would be
involved? I'm assuming the file and line information are already
stored inside the executable when '-g' is run, how easy would it be to
make gcc create an  executable that runs a user specified function on
each step given this input?

Thanks,

Ed


Including free compiler in a comercial software

2008-10-30 Thread Cristian Harja

Hello,

I'm a young developer, with very strong knowledge about programming, especially 
C++. I am working to one of my greatest projects. I'm building up a framework 
that can create native Win32 applications, console applications, and 
provides intelligent and efficient classes to manage different types of data.

Since this framework is a set of classes, templates and functions, I need a 
compiler to "bring it to life". I want to create my own programming 
environment,including a class browser (for the framework), a header manager (to 
include / exclude components), and detailed documentation. I want to SELL this 
software, so there's going to be a problem. I can't make my own compiler, and 
free compilers, usually should not be comercialized.

I want an advice, or an approvement to include GCC in my program (of course, 
mentioning it). I would also like to know if there are several compilers that 
can be "comercialized" this way. I do not intend to sell any free compiler. I 
am not going to provide any source code from my framework (only ".lib" and 
".h"). I can't provide just the headers and a lib, or something, because I 
don't know what differences may exist between the compilers.

Please answer me at <[EMAIL PROTECTED]>


Chris





Building GCC 4.3.2 on powerpc-yellowdog-linux-gnu

2008-10-30 Thread Angel Tsankov
Hi,

I'm trying to build (natively) GCC 4.3.2 on a
powerpc-yellowdog-linux-gnu. I have not yet managed to build it all
('make bootstrap') but I found out that each of the following changes
(applied in the order specified) takes me further on:

-- clear the LIBRARY_PATH variable, i.e. build with 'env LIBRARY_PATH=
make bootstrap';
-- insert '#include ' in libcpp/include/line-map.h:26 (to work
around errors about undefined CHAR_BIT or UINT_MAX);
-- insert '#include ' in gcc/real.h:29;
-- add BOOT_CFLAGS='-DENABLE_DECIMAL_FLOAT=1
-DENABLE_DECIMAL_BID_FORMAT=0' to 'make bootstrap' since these
macros were not defined (this is stage 2);
-- insert '#include ' in gcc/hard-reg-set.h:24;
-- insert '#include ' in gcc/toplev.h:24;
-- added -DHAVE_LIMITS_H to BOOT_CFLAGS;
-- added -DHAVE_GAS_SHF_MERGE=0 to BOOT_CFLAGS;

I wonder if these steps will eventually take me to a successful build of
GCC. In case this matters, the configuration script identifies the
build, host, and target systems as powerpc-unknown-linux-gnu.

Thanks in advance,
Angel Tsankov