[gnu.gcc.bug] integrate.c

tiemann@arkesden.eng.sun.com (Michael Tiemann) (12/13/89)

    arkesden% diff -c2 integrate.c~ integrate.c
    *** integrate.c~	Wed Dec  6 19:30:47 1989
    --- integrate.c	Tue Dec 12 11:16:16 1989
    ***************
    *** 1162,1166 ****
		     be ignored since we are changing (REG n) into
		     inline_target.  */
    ! 	      if (REG_FUNCTION_VALUE_P (XEXP (pattern, 0)))
		    break;
		  /* Don't emit a (USE (REG n)) of something which
    --- 1162,1166 ----
		     be ignored since we are changing (REG n) into
		     inline_target.  */
    ! 	      if (! ignore && REG_FUNCTION_VALUE_P (XEXP (pattern, 0)))
		    break;
		  /* Don't emit a (USE (REG n)) of something which
    arkesden% 

This fixes a problem which can be repeated by compiling the following
file with GCC version 1.36:

    typedef struct RegInfo
    {
      char val;
      char fake;
    } RegInfo;
    typedef struct Field
    {
      RegInfo* rip;
    } Field;
    inline char get_val(register Field *t)
    {
      return t->rip->fake;
    }
    Field *F ( register Field *t, RegInfo* ri )
    {
      t->rip = ri;
      get_val(t);
      ri->val = get_val(t);
      return t;
    }
    main()
    {
      RegInfo ri;
      Field f;
      F (&f, &ri);
    }

In this manner:

!gc
gcc l21.c -dr
arkesden% a.out
Segmentation fault
arkesden% 

Michael