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: [tree-ssa] Insert on edge fix


On 23 Jun 2003, Andrew MacLeod wrote:
> *************** find_insert_location (basic_block src, b
> *** 3880,3886 ****
>   		   abnormal edges.  In that case, we simple create a new block
>   		   right after this one, and then fall through to the
>   		   destination  block.  */
> ! 		ret = handle_switch_split (new_block, dest);
>   		*location = EDGE_INSERT_LOCATION_AFTER;
>   		break;
>   	      }
> --- 3880,3886 ----
>   		   abnormal edges.  In that case, we simple create a new block
>   		   right after this one, and then fall through to the
>   		   destination  block.  */
> ! 		ret = src->end_tree_p;
>   		*location = EDGE_INSERT_LOCATION_AFTER;
>   		break;
>   	      }

Much better, thanks!

		=== libjava Summary ===

# of expected passes		3017
# of unexpected failures	2
# of expected failures		16
# of untested testcases		13

That's with flag_disable_gimple = 0.  My test case appears to be fixed;
-fdump-tree-optimized output below... fileName is now initialized
correctly on every predecessor of the return statement.

I'll do some more testing, but this looks as though this patch fixes all
the bugs I had.

public class NameFinder
{
  private String createStackTraceElement(String file)
  {
    String fileName = file;
    int colon = file.lastIndexOf(':');
    if (colon > 0)
	  {
	    fileName = file.substring(0, colon);
	    try
	      {
		Integer.parseInt(file.substring(colon+1));
	      }
	    catch (NumberFormatException nfe) { /* ignore */ }
	  }

    return fileName;
  }
}

;; Function NameFinder.createStackTraceElement(java.lang.String) (_ZN10NameFinder23createStackTraceElementEPN4java4lang6StringE)

NameFinder.createStackTraceElement(java.lang.String) (this, file)
{
  struct java.lang.String * file.1;
  java.lang.String:: * lastIndexOf.2;
  int T.3;
  struct java.lang.String * file.4;
  int colon.5;
  java.lang.String:: * substring.6;
  struct java.lang.String * T.7;
  struct java.lang.String * file.8;
  int T.9;
  java.lang.String:: * substring.10;
  struct java.lang.String * T.11;
  struct java.lang.String * T.12;
  int (*<UPFNef50>) (struct java.lang.String *) parseInt.13;
  int T.14;
  void * * T.15;
  void * T.16;
  struct java.lang.String * fileName;

  {
    int colon;

    if (file == 0B)
      {
        _Jv_ThrowNullPointerException ()
      };
    lastIndexOf.2 = (java.lang.String:: *)lastIndexOf;
    T.3 = lastIndexOf.2 (file, 58);
    if (T.3 > 0)
      {
        if (file == 0B)
          {
            _Jv_ThrowNullPointerException ()
          };
        substring.6 = (java.lang.String:: *)substring;
        T.7 = substring.6 (file, 0, T.3);
        try
          {
            if (file == 0B)
              {
                _Jv_ThrowNullPointerException ()
              };
            T.9 = T.3 + 1;
            substring.10 = (java.lang.String:: *)substring;
            T.11 = substring.10 (file, T.9);
            parseInt.13 = (int (*<UPFNef50>) (struct java.lang.String *))parseInt;
            T.14 = parseInt.13 (T.11);
            fileName = T.7
          }
        catch
          {
            catch (struct java.lang.NumberFormatException)
              {
                {
                  struct java.lang.NumberFormatException * nfe;

                  fileName = T.7
                }
              }
          }
      }
    else
      {
        fileName = file
      };
    return fileName;
  }
}


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