PR c/8068

Jan Hubicka jh@suse.cz
Mon Mar 3 11:58:00 GMT 2003


> > On Sun, Feb 23, 2003 at 12:00:54AM -0500, Geert Bosch wrote:
> > > On Saturday, Feb 22, 2003, at 15:19 America/New_York, Jan Hubicka wrote:
> > > >Hmm, theoretically we can use stabs for debug and dwarf2 for unwind, 
> > > >but
> > > >I am not quite sure ada will deal with it.
> > > >Even without unwind info it is probably the best we can get.
> > > 
> > > It should work fine.
> > 
> > No, it won't.  Stabs doesn't really work on any 64-bit platform.
> > 
> > Yes, Solaris tries to use it, but gdb's behaviour with that is
> > less than stellar.  Which makes sense since the address field in
> > the debug info is still 32-bits wide.
> 
> Hi,
> The problem is that patch causes GCC to use divti in
> gnat.os_lib.argument_string_to_list where we previously optimized
> everything out.  This is caused by the second hunk of the patch.  Isn't
> it supposed to improve code quality?
> 
> Anyway the problem is that Bernd's SSE merge broke TImode passing for
> x86-64 as MUST_PASS_IN_STACK return 1 now (not sure why it is needed at
> all and why other vector modes are not listed).  Anyway this is wrong
> for x86-64.  WHat happent is that the TImode register has been then
> passed only in register but since MUST_PASS_IN_STACK returned 1
> function.c concluded that it is passed in both places.
> 
> OK for 3.3/mainline?
> 
> Honza
> 
> int a __attribute__ ((__mode__ (TI))) =5;
> int b __attribute__ ((__mode__ (TI))) = 2;
> int c __attribute__ ((__mode__ (TI)));
> main()
> {
>   c=a/b;
>   if (c!=2)
>     abort ();
> }
> Mon Mar  3 12:01:16 CET 2003  Jan Hubicka  <jh@suse.cz>
> 	* i386.c (classify_argument): Obey MUST_PASS_IN_STACK.
> 	* i386.h (MUST_PASS_IN_STACK): Use default_must_pass_in_stack
> 	for x86-64.
Oops, wrong version

Mon Mar  3 12:01:16 CET 2003  Jan Hubicka  <jh@suse.cz>
	* i386.c (classify_argument): Obey MUST_PASS_IN_STACK.
	* i386.h (MUST_PASS_IN_STACK): Use default_must_pass_in_stack
	for x86-64.
Index: config/i386/i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.544
diff -c -3 -p -r1.544 i386.c
*** config/i386/i386.c	28 Feb 2003 18:30:57 -0000	1.544
--- config/i386/i386.c	3 Mar 2003 11:00:43 -0000
*************** classify_argument (mode, type, classes, 
*** 1914,1919 ****
--- 1914,1923 ----
    if (bytes < 0)
      return 0;
  
+   if (mode != VOIDmode
+       && MUST_PASS_IN_STACK (mode, type))
+     return 0;
+ 
    if (type && AGGREGATE_TYPE_P (type))
      {
        int i;
Index: config/i386/i386.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.h,v
retrieving revision 1.327
diff -c -3 -p -r1.327 i386.h
*** config/i386/i386.h	25 Feb 2003 11:39:19 -0000	1.327
--- config/i386/i386.h	3 Mar 2003 11:00:43 -0000
*************** enum reg_class
*** 1665,1681 ****
     documentation. If `REG_PARM_STACK_SPACE' is defined, the argument will be
     computed in the stack and then loaded into a register.  */
  #define MUST_PASS_IN_STACK(MODE, TYPE)				\
!   ((TYPE) != 0							\
!    && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST		\
!        || TREE_ADDRESSABLE (TYPE)				\
!        || ((MODE) == TImode)					\
!        || ((MODE) == BLKmode 					\
! 	   && ! ((TYPE) != 0					\
! 		 && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \
! 		 && 0 == (int_size_in_bytes (TYPE)		\
! 			  % (PARM_BOUNDARY / BITS_PER_UNIT)))	\
! 	   && (FUNCTION_ARG_PADDING (MODE, TYPE)		\
! 	       == (BYTES_BIG_ENDIAN ? upward : downward)))))
  
  /* Value is the number of bytes of arguments automatically
     popped when returning from a subroutine call.
--- 1665,1682 ----
     documentation. If `REG_PARM_STACK_SPACE' is defined, the argument will be
     computed in the stack and then loaded into a register.  */
  #define MUST_PASS_IN_STACK(MODE, TYPE)				\
!   (TARGET_64BIT ? default_must_pass_in_stack ((MODE), (TYPE))	\
!    : ((TYPE) != 0						\
!       && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST		\
! 	  || TREE_ADDRESSABLE (TYPE)				\
! 	  || ((MODE) == TImode)					\
! 	  || ((MODE) == BLKmode 				\
! 	      && ! ((TYPE) != 0					\
! 		    && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST\
! 		    && 0 == (int_size_in_bytes (TYPE)		\
! 			     % (PARM_BOUNDARY / BITS_PER_UNIT)))\
! 	      && (FUNCTION_ARG_PADDING (MODE, TYPE)		\
! 		  == (BYTES_BIG_ENDIAN ? upward : downward))))))
  
  /* Value is the number of bytes of arguments automatically
     popped when returning from a subroutine call.



More information about the Gcc-patches mailing list