This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Simplified switch conversion in simple cases


Hi,

On Tue, Apr 21, 2009 at 10:28:54PM +0200, Eric Botcazou wrote:
> > 2009-04-20  Martin Jambor  <mjambor@suse.cz>
> >
> > 	* tree-switch-conversion.c (build_constructors): Split a long line.
> > 	(constructor_contains_same_values_p): New function.
> > 	(build_one_array): Create assigns of constants if possible, do not call
> > 	mark_sym_for_renaming, call update_stmt.
> > 	(build_arrays): Call make_ssa_name (create_tmp_var ()) instead of
> > 	make_rename_temp.  Do not call mark_symbols_for_renaming, call
> > 	update_stmt.
> > 	(gen_def_assigns): Do not call mark_symbols_for_renaming or
> > 	find_new_referenced_vars, call update_stmt.
> > 	(gen_inbound_check): Use create_tmp_var and create ssa names manually
> > 	instead of calling make_rename_temp.  Do not call
> > 	find_new_referenced_vars or mark_symbols_for_renaming, call
> > 	update_stmt.
> 
> This breaks Ada on x86:

I suppose this was also  fixed by Richi's patch yesterday.  Please let
me  know if  it wans't.   Sorry  for the  annoyance, it  was a  stupid
mistake.

Martin


> 
> /home/eric/build/gcc/native32/./gcc/xgcc -B/home/eric/build/gcc/native32/./gcc/ -B/home/eric/install/gcc/i586-suse-linux/bin/ -B/home/eric/install/gcc/i586-suse-linux/lib/ -isystem /home/eric/install/gcc/i586-suse-linux/include -isystem /home/eric/install/gcc/i586-suse-linux/sys-include -c -g -O2   -W -Wall -gnatpg   
> g-socket.adb -o g-socket.o
> +===========================GNAT BUG DETECTED==============================+
> | 4.5.0 20090421 (experimental) [trunk revision 146532] (i586-suse-linux-gnu) 
> GCC error:|
> | in make_decl_rtl, at varasm.c:1304                                       |
> | Error detected around g-socket.adb:1746                                  |
> | Please submit a bug report; see http://gcc.gnu.org/bugs.html.            |
> 
> Reduced testcase attached, compile with:
> 
> gcc/xgcc -Bgcc -S g-socket.adb -Igcc/ada/rts -O
> 
> 
> (gdb) frame 2
> #2  0x08cfa656 in make_decl_rtl (decl=0xf7e050b8)
>     at /home/eric/svn/gcc/gcc/varasm.c:1300
> 1300      gcc_assert (TREE_CODE (decl) != VAR_DECL
> (gdb) p debug_tree(decl)
>  <var_decl 0xf7e050b8 csui.11
>     type <integer_type 0xf7d31bd0 unsigned int sizes-gimplified public visited 
> unsigned SI
>         size <integer_cst 0xf7d1c604 constant 32>
>         unit size <integer_cst 0xf7d1c3f0 constant 4>
>         align 32 symtab 0 alias set -1 canonical type 0xf7d31bd0 precision 32 
> min <integer_cst 0xf7d1cd90 0> max <integer_cst 0xf7d1cb98 4294967295>>
>     used unsigned ignored SI file g-socket.adb line 52 col 1 size <integer_cst 
> 0xf7d1c604 32> unit size <integer_cst 0xf7d1c3f0 4>
>     align 32 context <function_decl 0xf7ddd800 
> gnat__sockets__resolve_exception> abstract_origin <var_decl 0xf7df89b4 
> csui.11>>
> 
> -- 
> Eric Botcazou

> with System.OS_Constants;
> 
> package body GNAT.Sockets is
> 
>    package SOSC renames System.OS_Constants;
> 
>    function Resolve_Error
>      (Error_Value : Integer;
>       From_Errno  : Boolean) return Error_Type
>    is
>       use SOSC;
>    begin
>       if not From_Errno then
>          case Error_Value is
>             when SOSC.HOST_NOT_FOUND => return Unknown_Host;
>             when SOSC.TRY_AGAIN      => return Host_Name_Lookup_Failure;
>             when SOSC.NO_RECOVERY    => return Non_Recoverable_Error;
>             when SOSC.NO_DATA        => return Unknown_Server_Error;
>             when others              => return Cannot_Resolve_Error;
>          end case;
>       end if;
> 
>       case Error_Value is
>          when EACCES          => return Permission_Denied;
>          when EADDRINUSE      => return Address_Already_In_Use;
>          when EADDRNOTAVAIL   => return Cannot_Assign_Requested_Address;
>          when EAFNOSUPPORT    => return
>                                  Address_Family_Not_Supported_By_Protocol;
>          when EALREADY        => return Operation_Already_In_Progress;
>          when EBADF           => return Bad_File_Descriptor;
>          when ECONNABORTED    => return Software_Caused_Connection_Abort;
>          when ECONNREFUSED    => return Connection_Refused;
>          when ECONNRESET      => return Connection_Reset_By_Peer;
>          when EDESTADDRREQ    => return Destination_Address_Required;
>          when EFAULT          => return Bad_Address;
>          when EHOSTDOWN       => return Host_Is_Down;
>          when EHOSTUNREACH    => return No_Route_To_Host;
>          when others          => return Cannot_Resolve_Error;
>       end case;
>    end;
> 
>    function Resolve_Exception
>      (Occurrence : Exception_Occurrence) return Error_Type
>    is
>       Msg   : constant String := Exception_Message (Occurrence);
>       Val   : Integer;
>    begin
>       Val := Integer'Value (Msg (1 .. 4));
>       return Resolve_Error (Val, False);
>    end;
> 
> end GNAT.Sockets;

> with Ada.Exceptions; use Ada.Exceptions;
> 
> package GNAT.Sockets is
> 
>    type Error_Type is
>      (Success,
>       Permission_Denied,
>       Address_Already_In_Use,
>       Cannot_Assign_Requested_Address,
>       Address_Family_Not_Supported_By_Protocol,
>       Operation_Already_In_Progress,
>       Bad_File_Descriptor,
>       Software_Caused_Connection_Abort,
>       Connection_Refused,
>       Connection_Reset_By_Peer,
>       Destination_Address_Required,
>       Bad_Address,
>       Host_Is_Down,
>       No_Route_To_Host,
>       Operation_Now_In_Progress,
>       Interrupted_System_Call,
>       Invalid_Argument,
>       Input_Output_Error,
>       Transport_Endpoint_Already_Connected,
>       Too_Many_Symbolic_Links,
>       Too_Many_Open_Files,
>       Message_Too_Long,
>       File_Name_Too_Long,
>       Network_Is_Down,
>       Network_Dropped_Connection_Because_Of_Reset,
>       Network_Is_Unreachable,
>       No_Buffer_Space_Available,
>       Protocol_Not_Available,
>       Transport_Endpoint_Not_Connected,
>       Socket_Operation_On_Non_Socket,
>       Operation_Not_Supported,
>       Protocol_Family_Not_Supported,
>       Protocol_Not_Supported,
>       Protocol_Wrong_Type_For_Socket,
>       Cannot_Send_After_Transport_Endpoint_Shutdown,
>       Socket_Type_Not_Supported,
>       Connection_Timed_Out,
>       Too_Many_References,
>       Resource_Temporarily_Unavailable,
>       Broken_Pipe,
>       Unknown_Host,
>       Host_Name_Lookup_Failure,
>       Non_Recoverable_Error,
>       Unknown_Server_Error,
>       Cannot_Resolve_Error);
> 
>    function Resolve_Exception
>      (Occurrence : Ada.Exceptions.Exception_Occurrence) return Error_Type;
> 
> end GNAT.Sockets;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]