Re: running GCC without any input files, but with plugins???

2011-04-08 Thread Andrew Stubbs

On 08/04/11 07:04, Basile Starynkevitch wrote:

So I am dreaming of a way to run gcc with cc1 but without input files.
Perhaps something like
   gcc -fplugin=foo.so -fplugin-arg-foo-bar=bee -frun-cc1-without-input


gcc -fplugin=foo.so -fplugin-arg-foo-bar=bee -x c /dev/null

Andrew


Parameter not passed in call expr

2011-04-08 Thread Ludovic Courtès
Hello,

The attached plug-in builds a function like this:

  my_function (void * parm.0)
  {
__builtin_puts (parm.0);
  }

However, the generated assembly clears the first-argument register
(%edi) before calling ‘puts’, instead of actually passing the parameter:

  my_function:
  .LFB0:
  .file 1 "tt.c"
  .loc 1 1 0
  .cfi_startproc
  .loc 1 1 0
  xorl  %edi, %edi  ;; %edi shouldn’t be cleared
  jmp   puts
  .cfi_endproc

Any idea what I’m doing wrong?

(Please let me know if I should direct such questions elsewhere.)

Thanks,
Ludo’.

int plugin_is_GPL_compatible;

#include 
#include 

#include 
#include 
#include 
#include 
#include 

static void
define_function (void *gcc_data, void *user_data)
{
  tree decl, void_ptr;
  location_t loc = input_location;

  void_ptr = build_pointer_type (void_type_node);
  decl = build_decl (loc, FUNCTION_DECL, get_identifier ("my_function"),
		 build_function_type_list (void_type_node,
	   void_ptr, NULL_TREE));

  tree parm;
  parm = build_decl (loc, PARM_DECL,
		 create_tmp_var_name ("parm"),
		 void_ptr);

  DECL_CONTEXT (parm) = decl;
  TREE_USED (parm) = true;
  DECL_ARGUMENTS (decl) = parm;

  tree result;
  result = build_decl (loc, RESULT_DECL, NULL_TREE, void_type_node);
  DECL_CONTEXT (result) = decl;
  DECL_ARTIFICIAL (result) = true;
  DECL_IGNORED_P (result) = true;
  DECL_RESULT (decl) = result;

  DECL_INITIAL (decl) =
build_block (NULL_TREE, NULL_TREE, decl, NULL_TREE);
  DECL_SAVED_TREE (decl) =
build_call_expr (built_in_decls[BUILT_IN_PUTS], 1, parm);

  TREE_PUBLIC (decl) = true;
  TREE_STATIC (decl) = true;
  TREE_USED (decl) = true;
  DECL_ARTIFICIAL (decl) = true;
  DECL_EXTERNAL (decl) = false;
  DECL_UNINLINABLE (decl) = true;

  set_cfun (NULL);
  current_function_decl = decl;
  allocate_struct_function (decl, false);
  cfun->function_end_locus = loc;

  cgraph_finalize_function (decl, false);
}

int
plugin_init (struct plugin_name_args *plugin_info,
	 struct plugin_gcc_version *version)
{
  if (!plugin_default_version_check (version, &gcc_version))
return 1;

  register_callback ("the-plugin", PLUGIN_START_UNIT,
		 define_function, NULL);

  return 0;
}

/*
   Local Variables:
   compile-command: "gcc -Wall -g -fPIC -shared -o t.so t.c -I`gcc -print-file-name=plugin`/include"
   End:
 */


GCC 4.4.6 Release Candidate available from gcc.gnu.org

2011-04-08 Thread Jakub Jelinek
The first release candidate for GCC 4.4.6 is available from

  ftp://gcc.gnu.org/pub/gcc/snapshots/4.4.6-RC-20110408

and shortly its mirrors.  It has been generated from SVN revision 172152.

I have so far bootstrapped and tested the release candidate on
x86_64-linux and i686-linux.  Please test it and report any issues to
bugzilla.

If all goes well, I'd like to release 4.4.6 late next week.


Porting GCC Ada / GNAT to GNU/Hurd as a GSoC project

2011-04-08 Thread Thomas Schwinge
Hallo!

We (that is, GNU Hurd) have a Google Summer of Code project application
by Vladimir Gorelov who wants to work on getting GNAT into a functional
state on GNU/Hurd, as per
.

Vladimir says to have several years of Ada experience, and has already
been in contact (regarding another project) with Sergey Rybin some months
ago, for example.

Are there any GCC Ada / GNAT / AdaCore folks interested in helping to
mentor this project?  We may not strictly require you for this task, but
it certainly won't hurt to have people around who know the GCC Ada
implementation.


By the way, is  the correct list for such questions, or
should they rather be sent to the GNAT chat list, as per
?


In case this task should turn out to be ``too easy'' for a GSoC project
(which is difficult to judge for me at the moment), he's also interested
in any further Ada on Hurd projects, like implementing natively in Ada
the ability to do Remote Procedure Calls, used to implement Hurd servers
(translators), for example.


Grüße,
 Thomas


pgpR9r2pmFlHo.pgp
Description: PGP signature


Re: Parameter not passed in call expr

2011-04-08 Thread Ian Lance Taylor
ludovic.cour...@inria.fr (Ludovic Courtès) writes:

>   DECL_INITIAL (decl) =
> build_block (NULL_TREE, NULL_TREE, decl, NULL_TREE);
>   DECL_SAVED_TREE (decl) =
> build_call_expr (built_in_decls[BUILT_IN_PUTS], 1, parm);

I would normally expect DECL_SAVED_TREE to be a BLOCK.  I don't know if
that is the problem here, but it is possible.

Ian


Re: Parameter not passed in call expr

2011-04-08 Thread Ludovic Courtès
Hi,

Ian Lance Taylor  writes:

> ludovic.cour...@inria.fr (Ludovic Courtès) writes:
>
>>   DECL_INITIAL (decl) =
>> build_block (NULL_TREE, NULL_TREE, decl, NULL_TREE);
>>   DECL_SAVED_TREE (decl) =
>> build_call_expr (built_in_decls[BUILT_IN_PUTS], 1, parm);
>
> I would normally expect DECL_SAVED_TREE to be a BLOCK.

AFAICS it’s often a statement list or a BIND expression, and a single
statement appears to work too (same problem with a statement list).
I think the problem lies elsewhere...

Thanks,
Ludo’.


The Linux binutils 2.21.51.0.8 is released

2011-04-08 Thread H.J. Lu
This is the beta release of binutils 2.21.51.0.8 for Linux, which is
based on binutils 2011 0408 in CVS on sourceware.org plus various
changes. It is purely for Linux.

All relevant patches in patches have been applied to the source tree.
You can take a look at patches/README to see what have been applied and
in what order they have been applied.

Starting from the 2.21.51.0.3 release, you must remove .ctors/.dtors
section sentinels when building glibc or other C run-time libraries.
Otherwise, you will run into:

http://sourceware.org/bugzilla/show_bug.cgi?id=12343

Starting from the 2.21.51.0.2 release, BFD linker has the working LTO
plugin support. It can be used with GCC 4.5 and above. For GCC 4.5, you
need to configure GCC with --enable-gold to enable LTO plugin support.

Starting from the 2.21.51.0.2 release, binutils fully supports compressed
debug sections.  However, compressed debug section isn't turned on by
default in assembler. I am planning to turn it on for x86 assembler in
the future release, which may lead to the Linux kernel bug messages like

WARNING: lib/ts_kmp.o (.zdebug_aranges): unexpected non-allocatable section.

But the resulting kernel works fine.

Starting from the 2.20.51.0.4 release, no diffs against the previous
release will be provided.

You can enable both gold and bfd ld with --enable-gold=both.  Gold will
be installed as ld.gold and bfd ld will be installed as ld.bfd.  By
default, ld.bfd will be installed as ld.  You can use the configure
option, --enable-gold=both/gold to choose gold as the default linker,
ld.  IA-32 binary and X64_64 binary tar balls are configured with
--enable-gold=both/ld --enable-plugins --enable-threads.

Starting from the 2.18.50.0.4 release, the x86 assembler no longer
accepts

fnstsw %eax

fnstsw stores 16bit into %ax and the upper 16bit of %eax is unchanged.
Please use

fnstsw %ax

Starting from the 2.17.50.0.4 release, the default output section LMA
(load memory address) has changed for allocatable sections from being
equal to VMA (virtual memory address), to keeping the difference between
LMA and VMA the same as the previous output section in the same region.

For

.data.init_task : { *(.data.init_task) }

LMA of .data.init_task section is equal to its VMA with the old linker.
With the new linker, it depends on the previous output section. You
can use

.data.init_task : AT (ADDR(.data.init_task)) { *(.data.init_task) }

to ensure that LMA of .data.init_task section is always equal to its
VMA. The linker script in the older 2.6 x86-64 kernel depends on the
old behavior.  You can add AT (ADDR(section)) to force LMA of
.data.init_task section equal to its VMA. It will work with both old
and new linkers. The x86-64 kernel linker script in kernel 2.6.13 and
above is OK.

The new x86_64 assembler no longer accepts

monitor %eax,%ecx,%edx

You should use

monitor %rax,%ecx,%edx

or
monitor

which works with both old and new x86_64 assemblers. They should
generate the same opcode.

The new i386/x86_64 assemblers no longer accept instructions for moving
between a segment register and a 32bit memory location, i.e.,

movl (%eax),%ds
movl %ds,(%eax)

To generate instructions for moving between a segment register and a
16bit memory location without the 16bit operand size prefix, 0x66,

mov (%eax),%ds
mov %ds,(%eax)

should be used. It will work with both new and old assemblers. The
assembler starting from 2.16.90.0.1 will also support

movw (%eax),%ds
movw %ds,(%eax)

without the 0x66 prefix. Patches for 2.4 and 2.6 Linux kernels are
available at

http://www.kernel.org/pub/linux/devel/binutils/linux-2.4-seg-4.patch
http://www.kernel.org/pub/linux/devel/binutils/linux-2.6-seg-5.patch

The ia64 assembler is now defaulted to tune for Itanium 2 processors.
To build a kernel for Itanium 1 processors, you will need to add

ifeq ($(CONFIG_ITANIUM),y)
CFLAGS += -Wa,-mtune=itanium1
AFLAGS += -Wa,-mtune=itanium1
endif

to arch/ia64/Makefile in your kernel source tree.

Please report any bugs related to binutils 2.21.51.0.8 to
hjl.to...@gmail.com

and

http://www.sourceware.org/bugzilla/

Changes from binutils 2.21.51.0.7:

1. Update from binutils 2011 0408.
2. Fix x32 TLS linker bug.
3. Enable .quad directive in x32 assembler.
4. Fix an assembler regression.  PRs 12569/12589.
5. Add --size-check= assembler option to issue a warning, instead of an
error, on bad ELF .size directive.
6. Fix an ia32 linker bug with TLS/PIE.  PR 12654.
7. Fix Intel L1OM linker library search path.
8. Fix a linker buffer overflow on malformed inputs.  PR 12613.
9. Check corrupted symtab in nm/readelf.  PR 12639.
10. Avoid objcopy crash on archive with unknown objects.  PR 12632.
11. Fix "ar -t".  PR 12590.
12. Fix many memory leaks.
13. Improve DWARF support.
14. Improve gold.
15. Improve VMS support.
16. Improve Windows support.
17. Improve alpha support.
18. Improve arm support.
19. Im

GCC Gathering in London 17/Jun to 19/Jun 2011

2011-04-08 Thread Diego Novillo
We are organizing a gathering of GCC developers and interested parties
at the Google office in London, UK for the weekend of 17-Jun-2011.
The gathering will be Friday evening, all day Saturday, and Sunday
until some time in the afternoon.

The idea is to simply get together and discuss current/future work,
coordinate efforts, and perhaps do some collective GCC hacking.

The format is going to be an informal unconference:

- No papers.
- No prepared presentations (unless it's really interesting).
- No attendance fees.

Google will provide meeting facilities and food.  We have space for
about 100 people.  Attendees are responsible for travel and
accommodations.  We will meet Friday evening and coordinate a list of
topics for discussion.  We could also work something out in advance.

At the moment, we need to know how many developers would attend.
Please RSVP before 22-Apr-2011.  Let us know if you might come; it's
not a commitment.

The Google London office is near Victoria Station at

Belgrave House
76 Buckingham Palace Road
London SW1W 9TQ
United Kingdom

http://maps.google.com/?q=Google%20London@51.495238,-0.146663&hl=en

Diego and Ian.


Frame Pointer Usage

2011-04-08 Thread Iyer, Balaji V
Hello Everyone,
I have a question regarding using frame pointers. I have a scenario 
where I need to use the frame for certain functions and for the other functions 
it can optimize it out. I see there is a flag called  
"-fno-omit-frame-pointer", which will keep the frame pointer for all the 
functions. Is there a way I can keep/remove the frame for a per-function basis? 
If this functionality is not present in GCC and if I want to add such a 
functionality, where/how should I go about implementing it?

Any help is greatly appreciated!

Thanks,

Balaji V. Iyer.

P.S. Please CC me when you respond to this message.


Re: Frame Pointer Usage

2011-04-08 Thread Ian Lance Taylor
"Iyer, Balaji V"  writes:

>   I have a question regarding using frame pointers. I have a scenario 
> where I need to use the frame for certain functions and for the other 
> functions it can optimize it out. I see there is a flag called  
> "-fno-omit-frame-pointer", which will keep the frame pointer for all the 
> functions. Is there a way I can keep/remove the frame for a per-function 
> basis? If this functionality is not present in GCC and if I want to add such 
> a functionality, where/how should I go about implementing it?

That is how gcc behaves anyhow.  It will use a frame pointer if it needs
one, whether or not -fomit-frame-pointer is in effect.  To control this
in your backend, see the frame_pointer_required target hook.

Ian


gcc-4.6-20110408 is now available

2011-04-08 Thread gccadmin
Snapshot gcc-4.6-20110408 is now available on
  ftp://gcc.gnu.org/pub/gcc/snapshots/4.6-20110408/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 4.6 SVN branch
with the following options: svn://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch 
revision 172216

You'll find:

 gcc-4.6-20110408.tar.bz2 Complete GCC (includes all of below)

  MD5=9a8fc79f5125c50564b8c6be21fbe642
  SHA1=52a1dedadd0920dfc95310dcb69d5f2cd67a15e7

 gcc-core-4.6-20110408.tar.bz2C front end and core compiler

  MD5=51ee21d6bd7955c78cb29038ff8089d0
  SHA1=a014c25aedb5ac0135b1fded66fa4d17f1e4750e

 gcc-ada-4.6-20110408.tar.bz2 Ada front end and runtime

  MD5=94de82b3148b7686901f35c223477813
  SHA1=8d318cbb12dd0f93e505e980654778138f520c27

 gcc-fortran-4.6-20110408.tar.bz2 Fortran front end and runtime

  MD5=7286e62b51e126226e10e0e6a1706eae
  SHA1=2f77d800a9661d8d0b23398ced2ce4a681228377

 gcc-g++-4.6-20110408.tar.bz2 C++ front end and runtime

  MD5=92144f8790ca850317b6f4496e534aef
  SHA1=83a304a14631f1fd34f8bb880eaa1cf24cce7692

 gcc-go-4.6-20110408.tar.bz2  Go front end and runtime

  MD5=6719f6e005e2e443ebc5a3609607e8ef
  SHA1=0381a0847131b2e9ba06232a84ffa79b50e9f9a6

 gcc-java-4.6-20110408.tar.bz2Java front end and runtime

  MD5=8e7ab41a40f5b73f47f7c678ebac5a5b
  SHA1=c5100bd12f62403ad2fdfc0478c631fb7156ed16

 gcc-objc-4.6-20110408.tar.bz2Objective-C front end and runtime

  MD5=a9da84a451c4484126b2befa446b1638
  SHA1=aa201c5db43082c0791236cc8fd309bf384aa251

 gcc-testsuite-4.6-20110408.tar.bz2   The GCC testsuite

  MD5=0a870e1180a0cb4ffa5264f0b79abe3f
  SHA1=86f282684b65e618a7817ac70e6f7216afab6ff5

Diffs from 4.6-20110401 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-4.6
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.