From f29f4ff4e3fa5872b3eafdbd9d35d6141c4ca1d5 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sat, 13 Dec 2014 12:34:31 +0000 Subject: [PATCH] Fix for br965. When performing constant propagation, we need to take into account values driven through a tran object. For now, be pessimistic, and assume that all tran objects connect to a variable driver. --- link_const.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/link_const.cc b/link_const.cc index 0e8c7e39d..ccc38801e 100644 --- a/link_const.cc +++ b/link_const.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2013 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2014 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -45,6 +45,14 @@ bool Nexus::drivers_constant() const return false; } + /* If we are connected to a tran, there may be a driver + on the other side of the tran. We could try checking + for this, but for now, be pessimistic. */ + if (dynamic_cast(cur->get_obj())) { + driven_ = VAR; + return false; + } + Link::DIR cur_dir = cur->get_dir(); if (cur_dir == Link::INPUT) continue;